<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-comment">{-
(c) The GRASP/AQUA Project, Glasgow University, 1992-2012

Note [Unarisation]
~~~~~~~~~~~~~~~~~~
The idea of this pass is to translate away *all* unboxed-tuple and unboxed-sum
binders. So for example:

  f (x :: (# Int, Bool #)) = f x + f (# 1, True #)

  ==&gt;

  f (x1 :: Int) (x2 :: Bool) = f x1 x2 + f 1 True

It is important that we do this at the STG level and NOT at the Core level
because it would be very hard to make this pass Core-type-preserving. In this
example the type of 'f' changes, for example.

STG fed to the code generators *must* be unarised because the code generators do
not support unboxed tuple and unboxed sum binders natively.

In more detail: (see next note for unboxed sums)

Suppose that a variable x : (# t1, t2 #).

  * At the binding site for x, make up fresh vars  x1:t1, x2:t2

  * Extend the UnariseEnv   x :-&gt; MultiVal [x1,x2]

  * Replace the binding with a curried binding for x1,x2

       Lambda:   \x.e                ==&gt;   \x1 x2. e
       Case alt: MkT a b x c d -&gt; e  ==&gt;   MkT a b x1 x2 c d -&gt; e

  * Replace argument occurrences with a sequence of args via a lookup in
    UnariseEnv

       f a b x c d   ==&gt;   f a b x1 x2 c d

  * Replace tail-call occurrences with an unboxed tuple via a lookup in
    UnariseEnv

       x  ==&gt;  (# x1, x2 #)

    So, for example

       f x = x    ==&gt;   f x1 x2 = (# x1, x2 #)

  * We /always/ eliminate a case expression when

       - It scrutinises an unboxed tuple or unboxed sum

       - The scrutinee is a variable (or when it is an explicit tuple, but the
         simplifier eliminates those)

    The case alternative (there can be only one) can be one of these two
    things:

      - An unboxed tuple pattern. e.g.

          case v of x { (# x1, x2, x3 #) -&gt; ... }

        Scrutinee has to be in form `(# t1, t2, t3 #)` so we just extend the
        environment with

          x :-&gt; MultiVal [t1,t2,t3]
          x1 :-&gt; UnaryVal t1, x2 :-&gt; UnaryVal t2, x3 :-&gt; UnaryVal t3

      - A DEFAULT alternative. Just the same, without the bindings for x1,x2,x3

By the end of this pass, we only have unboxed tuples in return positions.
Unboxed sums are completely eliminated, see next note.

Note [Translating unboxed sums to unboxed tuples]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unarise also eliminates unboxed sum binders, and translates unboxed sums in
return positions to unboxed tuples. We want to overlap fields of a sum when
translating it to a tuple to have efficient memory layout. When translating a
sum pattern to a tuple pattern, we need to translate it so that binders of sum
alternatives will be mapped to right arguments after the term translation. So
translation of sum DataCon applications to tuple DataCon applications and
translation of sum patterns to tuple patterns need to be in sync.

These translations work like this. Suppose we have

  (# x1 | | ... #) :: (# t1 | t2 | ... #)

remember that t1, t2 ... can be sums and tuples too. So we first generate
layouts of those. Then we &quot;merge&quot; layouts of each alternative, which gives us a
sum layout with best overlapping possible.

Layout of a flat type 'ty1' is just [ty1].
Layout of a tuple is just concatenation of layouts of its fields.

For layout of a sum type,

  - We first get layouts of all alternatives.
  - We sort these layouts based on their &quot;slot types&quot;.
  - We merge all the alternatives.

For example, say we have (# (# Int#, Char #) | (# Int#, Int# #) | Int# #)

  - Layouts of alternatives: [ [Word, LiftedPtr], [Word, Word], [Word] ]
  - Sorted: [ [LiftedPtr, Word], [Word, Word], [Word] ]
  - Merge all alternatives together: [ LiftedPtr, Word, Word ]

We add a slot for the tag to the first position. So our tuple type is

  (# Tag#, Any, Word#, Word# #)
  (we use Any for pointer slots)

Now, any term of this sum type needs to generate a tuple of this type instead.
The translation works by simply putting arguments to first slots that they fit
in. Suppose we had

  (# (# 42#, 'c' #) | | #)

42# fits in Word#, 'c' fits in Any, so we generate this application:

  (# 1#, 'c', 42#, rubbish #)

Another example using the same type: (# | (# 2#, 3# #) | #). 2# fits in Word#,
3# fits in Word #, so we get:

  (# 2#, rubbish, 2#, 3# #).


Note [Don't merge lifted and unlifted slots]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When merging slots, one might be tempted to collapse lifted and unlifted
pointers. However, as seen in #19645, this is wrong. Imagine that you have
the program:

  test :: (# Char | ByteArray# #) -&gt; ByteArray#
  test (# c | #) = doSomething c
  test (# | ba #) = ba

Collapsing the Char and ByteArray# slots would produce STG like:

  test :: forall {t}. (# t | GHC.Prim.ByteArray# #) -&gt; GHC.Prim.ByteArray#
    = {} \r [ (tag :: Int#) (slot0 :: (Any :: Type)) ]
          case tag of tag'
            1# -&gt; doSomething slot0
            2# -&gt; slot0;

Note how `slot0` has a lifted type, despite being bound to an unlifted
ByteArray# in the 2# alternative. This liftedness would cause the code generator to
attempt to enter it upon returning. As unlifted objects do not have entry code,
this causes a runtime crash.

For this reason, Unarise treats unlifted and lifted things as distinct slot
types, despite both being GC pointers. This approach is a slight pessimisation
(since we need to pass more arguments) but appears to be the simplest way to
avoid #19645. Other alternatives considered include:

 a. Giving unlifted objects &quot;trivial&quot; entry code. However, we ultimately
    concluded that the value of the &quot;unlifted things are never entered&quot; invariant
    outweighed the simplicity of this approach.

 b. Annotating occurrences with calling convention information instead of
    relying on the binder's type. This seemed like a very complicated
    way to fix what is ultimately a corner-case.


Note [Types in StgConApp]
~~~~~~~~~~~~~~~~~~~~~~~~~
Suppose we have this unboxed sum term:

  (# 123 | #)

What will be the unboxed tuple representation? We can't tell without knowing the
type of this term. For example, these are all valid tuples for this:

  (# 1#, 123 #)          -- when type is (# Int | String #)
  (# 1#, 123, rubbish #) -- when type is (# Int | Float# #)
  (# 1#, 123, rubbish, rubbish #)
                         -- when type is (# Int | (# Int, Int, Int #) #)

So we pass type arguments of the DataCon's TyCon in StgConApp to decide what
layout to use. Note that unlifted values can't be let-bound, so we don't need
types in StgRhsCon.

Note [UnariseEnv can map to literals]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To avoid redundant case expressions when unarising unboxed sums, UnariseEnv
needs to map variables to literals too. Suppose we have this Core:

  f (# x | #)

  ==&gt; (CorePrep)

  case (# x | #) of y {
    _ -&gt; f y
  }

  ==&gt; (MultiVal)

  case (# 1#, x #) of [x1, x2] {
    _ -&gt; f x1 x2
  }

To eliminate this case expression we need to map x1 to 1# in UnariseEnv:

  x1 :-&gt; UnaryVal 1#, x2 :-&gt; UnaryVal x

so that `f x1 x2` becomes `f 1# x`.

Note [Unarisation and arity]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Because of unarisation, the arity that will be recorded in the generated info
table for an Id may be larger than the idArity. Instead we record what we call
the RepArity, which is the Arity taking into account any expanded arguments, and
corresponds to the number of (possibly-void) *registers* arguments will arrive
in.

Note [Post-unarisation invariants]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
STG programs after unarisation have these invariants:

  * No unboxed sums at all.

  * No unboxed tuple binders. Tuples only appear in return position.

  * DataCon applications (StgRhsCon and StgConApp) don't have void arguments.
    This means that it's safe to wrap `StgArg`s of DataCon applications with
    `GHC.StgToCmm.Env.NonVoid`, for example.

  * Alt binders (binders in patterns) are always non-void.

  * Binders always have zero (for void arguments) or one PrimRep.
-}</span><span>
</span><span id="line-234"></span><span>
</span><span id="line-235"></span><span class="hs-pragma">{-# LANGUAGE CPP, TupleSections, PatternSynonyms #-}</span><span>
</span><span id="line-236"></span><span>
</span><span id="line-237"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}</span><span>
</span><span id="line-238"></span><span>
</span><span id="line-239"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Stg.Unarise</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#unarise"><span class="hs-identifier">unarise</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-243"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-244"></span><span>
</span><span id="line-245"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>
</span><span id="line-246"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.html"><span class="hs-identifier">GHC.Core</span></a></span><span>
</span><span id="line-247"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html"><span class="hs-identifier">GHC.Core.DataCon</span></a></span><span>
</span><span id="line-248"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier">FastString</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier">mkFastString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-249"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-250"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Literal.html"><span class="hs-identifier">GHC.Types.Literal</span></a></span><span>
</span><span id="line-251"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Make.html"><span class="hs-identifier">GHC.Core.Make</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Make.html#aBSENT_SUM_FIELD_ERROR_ID"><span class="hs-identifier">aBSENT_SUM_FIELD_ERROR_ID</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-252"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.Make.html"><span class="hs-identifier">GHC.Types.Id.Make</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Id.Make.html#voidPrimId"><span class="hs-identifier">voidPrimId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Id.Make.html#voidArgId"><span class="hs-identifier">voidArgId</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-253"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Monad.html"><span class="hs-identifier">GHC.Utils.Monad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Monad.html#mapAccumLM"><span class="hs-identifier">mapAccumLM</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-254"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-255"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html"><span class="hs-identifier">GHC.Types.RepType</span></a></span><span>
</span><span id="line-256"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html"><span class="hs-identifier">GHC.Stg.Syntax</span></a></span><span>
</span><span id="line-257"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>
</span><span id="line-258"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.Prim.html"><span class="hs-identifier">GHC.Builtin.Types.Prim</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Builtin.Types.Prim.html#intPrimTy"><span class="hs-identifier">intPrimTy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-259"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html"><span class="hs-identifier">GHC.Builtin.Types</span></a></span><span>
</span><span id="line-260"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html"><span class="hs-identifier">GHC.Types.Unique.Supply</span></a></span><span>
</span><span id="line-261"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-262"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html"><span class="hs-identifier">GHC.Types.Var.Env</span></a></span><span>
</span><span id="line-263"></span><span>
</span><span id="line-264"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Bifunctor.html#"><span class="hs-identifier">Data.Bifunctor</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Bifunctor.html#second"><span class="hs-identifier">second</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-265"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Maybe.html#"><span class="hs-identifier">Data.Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Maybe.html#mapMaybe"><span class="hs-identifier">mapMaybe</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-266"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.IntMap.html#"><span class="hs-identifier">Data.IntMap</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">IM</span></span><span>
</span><span id="line-267"></span><span>
</span><span id="line-268"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-269"></span><span>
</span><span id="line-270"></span><span class="hs-comment">-- | A mapping from binders to the Ids they were expanded/renamed to.</span><span>
</span><span id="line-271"></span><span class="hs-comment">--</span><span>
</span><span id="line-272"></span><span class="hs-comment">--   x :-&gt; MultiVal [a,b,c] in rho</span><span>
</span><span id="line-273"></span><span class="hs-comment">--</span><span>
</span><span id="line-274"></span><span class="hs-comment">-- iff  x's typePrimRep is not a singleton, or equivalently</span><span>
</span><span id="line-275"></span><span class="hs-comment">--      x's type is an unboxed tuple, sum or void.</span><span>
</span><span id="line-276"></span><span class="hs-comment">--</span><span>
</span><span id="line-277"></span><span class="hs-comment">--    x :-&gt; UnaryVal x'</span><span>
</span><span id="line-278"></span><span class="hs-comment">--</span><span>
</span><span id="line-279"></span><span class="hs-comment">-- iff x's RepType is UnaryRep or equivalently</span><span>
</span><span id="line-280"></span><span class="hs-comment">--     x's type is not unboxed tuple, sum or void.</span><span>
</span><span id="line-281"></span><span class="hs-comment">--</span><span>
</span><span id="line-282"></span><span class="hs-comment">-- So</span><span>
</span><span id="line-283"></span><span class="hs-comment">--     x :-&gt; MultiVal [a] in rho</span><span>
</span><span id="line-284"></span><span class="hs-comment">-- means x is represented by singleton tuple.</span><span>
</span><span id="line-285"></span><span class="hs-comment">--</span><span>
</span><span id="line-286"></span><span class="hs-comment">--     x :-&gt; MultiVal [] in rho</span><span>
</span><span id="line-287"></span><span class="hs-comment">-- means x is void.</span><span>
</span><span id="line-288"></span><span class="hs-comment">--</span><span>
</span><span id="line-289"></span><span class="hs-comment">-- INVARIANT: OutStgArgs in the range only have NvUnaryTypes</span><span>
</span><span id="line-290"></span><span class="hs-comment">--            (i.e. no unboxed tuples, sums or voids)</span><span>
</span><span id="line-291"></span><span class="hs-comment">--</span><span>
</span><span id="line-292"></span><span class="hs-keyword">type</span><span> </span><span id="UnariseEnv"><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-var">UnariseEnv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#VarEnv"><span class="hs-identifier hs-type">VarEnv</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseVal"><span class="hs-identifier hs-type">UnariseVal</span></a></span><span>
</span><span id="line-293"></span><span>
</span><span id="line-294"></span><span class="hs-keyword">data</span><span> </span><span id="UnariseVal"><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseVal"><span class="hs-identifier hs-var">UnariseVal</span></a></span></span><span>
</span><span id="line-295"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="MultiVal"><span class="annot"><a href="GHC.Stg.Unarise.html#MultiVal"><span class="hs-identifier hs-var">MultiVal</span></a></span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#OutStgArg"><span class="hs-identifier hs-type">OutStgArg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- MultiVal to tuple. Can be empty list (void).</span><span>
</span><span id="line-296"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="UnaryVal"><span class="annot"><a href="GHC.Stg.Unarise.html#UnaryVal"><span class="hs-identifier hs-var">UnaryVal</span></a></span></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#OutStgArg"><span class="hs-identifier hs-type">OutStgArg</span></a></span><span>   </span><span class="hs-comment">-- See NOTE [Renaming during unarisation].</span><span>
</span><span id="line-297"></span><span>
</span><span id="line-298"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680953732"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseVal"><span class="hs-identifier hs-type">UnariseVal</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-299"></span><span>  </span><span id="local-6989586621680953728"><span class="annot"><span class="annottext">ppr :: UnariseVal -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#MultiVal"><span class="hs-identifier hs-type">MultiVal</span></a></span><span> </span><span id="local-6989586621680953726"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953726"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;MultiVal&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953726"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-300"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#UnaryVal"><span class="hs-identifier hs-type">UnaryVal</span></a></span><span> </span><span id="local-6989586621680953723"><span class="annot"><span class="annottext">OutStgArg
</span><a href="#local-6989586621680953723"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;UnaryVal&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">OutStgArg -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">OutStgArg
</span><a href="#local-6989586621680953723"><span class="hs-identifier hs-var">arg</span></a></span><span>
</span><span id="line-301"></span><span>
</span><span id="line-302"></span><span class="hs-comment">-- | Extend the environment, checking the UnariseEnv invariant.</span><span>
</span><span id="line-303"></span><span class="annot"><a href="GHC.Stg.Unarise.html#extendRho"><span class="hs-identifier hs-type">extendRho</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseVal"><span class="hs-identifier hs-type">UnariseVal</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span>
</span><span id="line-304"></span><span id="extendRho"><span class="annot"><span class="annottext">extendRho :: UnariseEnv -&gt; Id -&gt; UnariseVal -&gt; UnariseEnv
</span><a href="GHC.Stg.Unarise.html#extendRho"><span class="hs-identifier hs-var hs-var">extendRho</span></a></span></span><span> </span><span id="local-6989586621680953721"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953721"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span id="local-6989586621680953720"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953720"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#MultiVal"><span class="hs-identifier hs-type">MultiVal</span></a></span><span> </span><span id="local-6989586621680953719"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953719"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-305"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">all</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">isNvUnaryType</span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-identifier">stgArgType</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">args</span><span class="hs-special">)</span><span>
</span><span id="line-306"></span><span>    </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; UnariseVal -&gt; UnariseEnv
forall a. VarEnv a -&gt; Id -&gt; a -&gt; VarEnv a
</span><a href="GHC.Types.Var.Env.html#extendVarEnv"><span class="hs-identifier hs-var">extendVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953721"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953720"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OutStgArg] -&gt; UnariseVal
</span><a href="GHC.Stg.Unarise.html#MultiVal"><span class="hs-identifier hs-var">MultiVal</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953719"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-307"></span><span class="annot"><a href="GHC.Stg.Unarise.html#extendRho"><span class="hs-identifier hs-var">extendRho</span></a></span><span> </span><span id="local-6989586621680953709"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953709"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span id="local-6989586621680953708"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953708"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#UnaryVal"><span class="hs-identifier hs-type">UnaryVal</span></a></span><span> </span><span id="local-6989586621680953707"><span class="annot"><span class="annottext">OutStgArg
</span><a href="#local-6989586621680953707"><span class="hs-identifier hs-var">val</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-308"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">isNvUnaryType</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">stgArgType</span><span> </span><span class="hs-identifier">val</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-309"></span><span>    </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; UnariseVal -&gt; UnariseEnv
forall a. VarEnv a -&gt; Id -&gt; a -&gt; VarEnv a
</span><a href="GHC.Types.Var.Env.html#extendVarEnv"><span class="hs-identifier hs-var">extendVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953709"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953708"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OutStgArg -&gt; UnariseVal
</span><a href="GHC.Stg.Unarise.html#UnaryVal"><span class="hs-identifier hs-var">UnaryVal</span></a></span><span> </span><span class="annot"><span class="annottext">OutStgArg
</span><a href="#local-6989586621680953707"><span class="hs-identifier hs-var">val</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-310"></span><span>
</span><span id="line-311"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-312"></span><span>
</span><span id="line-313"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unarise"><span class="hs-identifier hs-type">unarise</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSupply"><span class="hs-identifier hs-type">UniqSupply</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopBinding"><span class="hs-identifier hs-type">StgTopBinding</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopBinding"><span class="hs-identifier hs-type">StgTopBinding</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-314"></span><span id="unarise"><span class="annot"><span class="annottext">unarise :: UniqSupply -&gt; [StgTopBinding] -&gt; [StgTopBinding]
</span><a href="GHC.Stg.Unarise.html#unarise"><span class="hs-identifier hs-var hs-var">unarise</span></a></span></span><span> </span><span id="local-6989586621680953706"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621680953706"><span class="hs-identifier hs-var">us</span></a></span></span><span> </span><span id="local-6989586621680953705"><span class="annot"><span class="annottext">[StgTopBinding]
</span><a href="#local-6989586621680953705"><span class="hs-identifier hs-var">binds</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; UniqSM [StgTopBinding] -&gt; [StgTopBinding]
forall a. UniqSupply -&gt; UniqSM a -&gt; a
</span><a href="GHC.Types.Unique.Supply.html#initUs_"><span class="hs-identifier hs-var">initUs_</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621680953706"><span class="hs-identifier hs-var">us</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(StgTopBinding -&gt; UniqSM StgTopBinding)
-&gt; [StgTopBinding] -&gt; UniqSM [StgTopBinding]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnariseEnv -&gt; StgTopBinding -&gt; UniqSM StgTopBinding
</span><a href="GHC.Stg.Unarise.html#unariseTopBinding"><span class="hs-identifier hs-var">unariseTopBinding</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
forall a. VarEnv a
</span><a href="GHC.Types.Var.Env.html#emptyVarEnv"><span class="hs-identifier hs-var">emptyVarEnv</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[StgTopBinding]
</span><a href="#local-6989586621680953705"><span class="hs-identifier hs-var">binds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-315"></span><span>
</span><span id="line-316"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseTopBinding"><span class="hs-identifier hs-type">unariseTopBinding</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopBinding"><span class="hs-identifier hs-type">StgTopBinding</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopBinding"><span class="hs-identifier hs-type">StgTopBinding</span></a></span><span>
</span><span id="line-317"></span><span id="unariseTopBinding"><span class="annot"><span class="annottext">unariseTopBinding :: UnariseEnv -&gt; StgTopBinding -&gt; UniqSM StgTopBinding
</span><a href="GHC.Stg.Unarise.html#unariseTopBinding"><span class="hs-identifier hs-var hs-var">unariseTopBinding</span></a></span></span><span> </span><span id="local-6989586621680953700"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953700"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopLifted"><span class="hs-identifier hs-type">StgTopLifted</span></a></span><span> </span><span id="local-6989586621680953698"><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680953698"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-318"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla -&gt; StgTopBinding
forall (pass :: StgPass).
GenStgBinding pass -&gt; GenStgTopBinding pass
</span><a href="GHC.Stg.Syntax.html#StgTopLifted"><span class="hs-identifier hs-var">StgTopLifted</span></a></span><span> </span><span class="annot"><span class="annottext">(GenStgBinding 'Vanilla -&gt; StgTopBinding)
-&gt; UniqSM (GenStgBinding 'Vanilla) -&gt; UniqSM StgTopBinding
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
-&gt; GenStgBinding 'Vanilla -&gt; UniqSM (GenStgBinding 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseBinding"><span class="hs-identifier hs-var">unariseBinding</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953700"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680953698"><span class="hs-identifier hs-var">bind</span></a></span><span>
</span><span id="line-319"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseTopBinding"><span class="hs-identifier hs-var">unariseTopBinding</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680953695"><span class="annot"><span class="annottext">bind :: StgTopBinding
</span><a href="#local-6989586621680953695"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopStringLit"><span class="hs-identifier hs-type">StgTopStringLit</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StgTopBinding -&gt; UniqSM StgTopBinding
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">StgTopBinding
</span><a href="#local-6989586621680953695"><span class="hs-identifier hs-var">bind</span></a></span><span>
</span><span id="line-320"></span><span>
</span><span id="line-321"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseBinding"><span class="hs-identifier hs-type">unariseBinding</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgBinding"><span class="hs-identifier hs-type">StgBinding</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgBinding"><span class="hs-identifier hs-type">StgBinding</span></a></span><span>
</span><span id="line-322"></span><span id="unariseBinding"><span class="annot"><span class="annottext">unariseBinding :: UnariseEnv
-&gt; GenStgBinding 'Vanilla -&gt; UniqSM (GenStgBinding 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseBinding"><span class="hs-identifier hs-var hs-var">unariseBinding</span></a></span></span><span> </span><span id="local-6989586621680953692"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953692"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgNonRec"><span class="hs-identifier hs-type">StgNonRec</span></a></span><span> </span><span id="local-6989586621680953690"><span class="annot"><span class="annottext">BinderP 'Vanilla
</span><a href="#local-6989586621680953690"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621680953689"><span class="annot"><span class="annottext">GenStgRhs 'Vanilla
</span><a href="#local-6989586621680953689"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-323"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BinderP 'Vanilla -&gt; GenStgRhs 'Vanilla -&gt; GenStgBinding 'Vanilla
forall (pass :: StgPass).
BinderP pass -&gt; GenStgRhs pass -&gt; GenStgBinding pass
</span><a href="GHC.Stg.Syntax.html#StgNonRec"><span class="hs-identifier hs-var">StgNonRec</span></a></span><span> </span><span class="annot"><span class="annottext">BinderP 'Vanilla
</span><a href="#local-6989586621680953690"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">(GenStgRhs 'Vanilla -&gt; GenStgBinding 'Vanilla)
-&gt; UniqSM (GenStgRhs 'Vanilla) -&gt; UniqSM (GenStgBinding 'Vanilla)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; GenStgRhs 'Vanilla -&gt; UniqSM (GenStgRhs 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseRhs"><span class="hs-identifier hs-var">unariseRhs</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953692"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgRhs 'Vanilla
</span><a href="#local-6989586621680953689"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-324"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseBinding"><span class="hs-identifier hs-var">unariseBinding</span></a></span><span> </span><span id="local-6989586621680953687"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953687"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgRec"><span class="hs-identifier hs-type">StgRec</span></a></span><span> </span><span id="local-6989586621680953685"><span class="annot"><span class="annottext">[(BinderP 'Vanilla, GenStgRhs 'Vanilla)]
</span><a href="#local-6989586621680953685"><span class="hs-identifier hs-var">xrhss</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-325"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Id, GenStgRhs 'Vanilla)] -&gt; GenStgBinding 'Vanilla
forall (pass :: StgPass).
[(BinderP pass, GenStgRhs pass)] -&gt; GenStgBinding pass
</span><a href="GHC.Stg.Syntax.html#StgRec"><span class="hs-identifier hs-var">StgRec</span></a></span><span> </span><span class="annot"><span class="annottext">([(Id, GenStgRhs 'Vanilla)] -&gt; GenStgBinding 'Vanilla)
-&gt; UniqSM [(Id, GenStgRhs 'Vanilla)]
-&gt; UniqSM (GenStgBinding 'Vanilla)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">((Id, GenStgRhs 'Vanilla) -&gt; UniqSM (Id, GenStgRhs 'Vanilla))
-&gt; [(Id, GenStgRhs 'Vanilla)] -&gt; UniqSM [(Id, GenStgRhs 'Vanilla)]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621680953684"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953684"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953683"><span class="annot"><span class="annottext">GenStgRhs 'Vanilla
</span><a href="#local-6989586621680953683"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953684"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(GenStgRhs 'Vanilla -&gt; (Id, GenStgRhs 'Vanilla))
-&gt; UniqSM (GenStgRhs 'Vanilla) -&gt; UniqSM (Id, GenStgRhs 'Vanilla)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; GenStgRhs 'Vanilla -&gt; UniqSM (GenStgRhs 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseRhs"><span class="hs-identifier hs-var">unariseRhs</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953687"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgRhs 'Vanilla
</span><a href="#local-6989586621680953683"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Id, GenStgRhs 'Vanilla)]
[(BinderP 'Vanilla, GenStgRhs 'Vanilla)]
</span><a href="#local-6989586621680953685"><span class="hs-identifier hs-var">xrhss</span></a></span><span>
</span><span id="line-326"></span><span>
</span><span id="line-327"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseRhs"><span class="hs-identifier hs-type">unariseRhs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgRhs"><span class="hs-identifier hs-type">StgRhs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgRhs"><span class="hs-identifier hs-type">StgRhs</span></a></span><span>
</span><span id="line-328"></span><span id="unariseRhs"><span class="annot"><span class="annottext">unariseRhs :: UnariseEnv -&gt; GenStgRhs 'Vanilla -&gt; UniqSM (GenStgRhs 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseRhs"><span class="hs-identifier hs-var hs-var">unariseRhs</span></a></span></span><span> </span><span id="local-6989586621680953681"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953681"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgRhsClosure"><span class="hs-identifier hs-type">StgRhsClosure</span></a></span><span> </span><span id="local-6989586621680953679"><span class="annot"><span class="annottext">XRhsClosure 'Vanilla
</span><a href="#local-6989586621680953679"><span class="hs-identifier hs-var">ext</span></a></span></span><span> </span><span id="local-6989586621680953678"><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621680953678"><span class="hs-identifier hs-var">ccs</span></a></span></span><span> </span><span id="local-6989586621680953677"><span class="annot"><span class="annottext">UpdateFlag
</span><a href="#local-6989586621680953677"><span class="hs-identifier hs-var">update_flag</span></a></span></span><span> </span><span id="local-6989586621680953676"><span class="annot"><span class="annottext">[BinderP 'Vanilla]
</span><a href="#local-6989586621680953676"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621680953675"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953675"><span class="hs-identifier hs-var">expr</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-329"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680953674"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953674"><span class="hs-identifier hs-var">rho'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953673"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953673"><span class="hs-identifier hs-var">args1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; [Id] -&gt; UniqSM (UnariseEnv, [Id])
</span><a href="GHC.Stg.Unarise.html#unariseFunArgBinders"><span class="hs-identifier hs-var">unariseFunArgBinders</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953681"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[BinderP 'Vanilla]
</span><a href="#local-6989586621680953676"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-330"></span><span>       </span><span id="local-6989586621680953671"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953671"><span class="hs-identifier hs-var">expr'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953674"><span class="hs-identifier hs-var">rho'</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953675"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-331"></span><span>       </span><span class="annot"><span class="annottext">GenStgRhs 'Vanilla -&gt; UniqSM (GenStgRhs 'Vanilla)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XRhsClosure 'Vanilla
-&gt; CostCentreStack
-&gt; UpdateFlag
-&gt; [BinderP 'Vanilla]
-&gt; GenStgExpr 'Vanilla
-&gt; GenStgRhs 'Vanilla
forall (pass :: StgPass).
XRhsClosure pass
-&gt; CostCentreStack
-&gt; UpdateFlag
-&gt; [BinderP pass]
-&gt; GenStgExpr pass
-&gt; GenStgRhs pass
</span><a href="GHC.Stg.Syntax.html#StgRhsClosure"><span class="hs-identifier hs-var">StgRhsClosure</span></a></span><span> </span><span class="annot"><span class="annottext">XRhsClosure 'Vanilla
</span><a href="#local-6989586621680953679"><span class="hs-identifier hs-var">ext</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621680953678"><span class="hs-identifier hs-var">ccs</span></a></span><span> </span><span class="annot"><span class="annottext">UpdateFlag
</span><a href="#local-6989586621680953677"><span class="hs-identifier hs-var">update_flag</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[BinderP 'Vanilla]
</span><a href="#local-6989586621680953673"><span class="hs-identifier hs-var">args1</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953671"><span class="hs-identifier hs-var">expr'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-332"></span><span>
</span><span id="line-333"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseRhs"><span class="hs-identifier hs-var">unariseRhs</span></a></span><span> </span><span id="local-6989586621680953669"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953669"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgRhsCon"><span class="hs-identifier hs-type">StgRhsCon</span></a></span><span> </span><span id="local-6989586621680953667"><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621680953667"><span class="hs-identifier hs-var">ccs</span></a></span></span><span> </span><span id="local-6989586621680953666"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680953666"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span id="local-6989586621680953665"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953665"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-334"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">not</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">isUnboxedTupleCon</span><span> </span><span class="hs-identifier">con</span><span> </span><span class="hs-operator">||</span><span> </span><span class="hs-identifier">isUnboxedSumCon</span><span> </span><span class="hs-identifier">con</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-335"></span><span>    </span><span class="annot"><span class="annottext">GenStgRhs 'Vanilla -&gt; UniqSM (GenStgRhs 'Vanilla)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CostCentreStack -&gt; DataCon -&gt; [OutStgArg] -&gt; GenStgRhs 'Vanilla
forall (pass :: StgPass).
CostCentreStack -&gt; DataCon -&gt; [OutStgArg] -&gt; GenStgRhs pass
</span><a href="GHC.Stg.Syntax.html#StgRhsCon"><span class="hs-identifier hs-var">StgRhsCon</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621680953667"><span class="hs-identifier hs-var">ccs</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680953666"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnariseEnv -&gt; [OutStgArg] -&gt; [OutStgArg]
</span><a href="GHC.Stg.Unarise.html#unariseConArgs"><span class="hs-identifier hs-var">unariseConArgs</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953669"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953665"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-336"></span><span>
</span><span id="line-337"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-338"></span><span>
</span><span id="line-339"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-type">unariseExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgExpr"><span class="hs-identifier hs-type">StgExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgExpr"><span class="hs-identifier hs-type">StgExpr</span></a></span><span>
</span><span id="line-340"></span><span>
</span><span id="line-341"></span><span id="unariseExpr"><span class="annot"><span class="annottext">unariseExpr :: UnariseEnv -&gt; GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var hs-var">unariseExpr</span></a></span></span><span> </span><span id="local-6989586621680953659"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953659"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span id="local-6989586621680953658"><span class="annot"><span class="annottext">e :: GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953658"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgApp"><span class="hs-identifier hs-type">StgApp</span></a></span><span> </span><span id="local-6989586621680953656"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953656"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-342"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; Maybe UnariseVal
forall a. VarEnv a -&gt; Id -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupVarEnv"><span class="hs-identifier hs-var">lookupVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953659"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953656"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-343"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#MultiVal"><span class="hs-identifier hs-type">MultiVal</span></a></span><span> </span><span id="local-6989586621680953654"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953654"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- Including empty tuples</span><span>
</span><span id="line-344"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OutStgArg] -&gt; GenStgExpr 'Vanilla
</span><a href="GHC.Stg.Unarise.html#mkTuple"><span class="hs-identifier hs-var">mkTuple</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953654"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-345"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#UnaryVal"><span class="hs-identifier hs-type">UnaryVal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgVarArg"><span class="hs-identifier hs-type">StgVarArg</span></a></span><span> </span><span id="local-6989586621680953651"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953651"><span class="hs-identifier hs-var">f'</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-346"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; [OutStgArg] -&gt; GenStgExpr 'Vanilla
forall (pass :: StgPass). Id -&gt; [OutStgArg] -&gt; GenStgExpr pass
</span><a href="GHC.Stg.Syntax.html#StgApp"><span class="hs-identifier hs-var">StgApp</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953651"><span class="hs-identifier hs-var">f'</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-347"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#UnaryVal"><span class="hs-identifier hs-type">UnaryVal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgLitArg"><span class="hs-identifier hs-type">StgLitArg</span></a></span><span> </span><span id="local-6989586621680953649"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680953649"><span class="hs-identifier hs-var">f'</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-348"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Literal -&gt; GenStgExpr 'Vanilla
forall (pass :: StgPass). Literal -&gt; GenStgExpr pass
</span><a href="GHC.Stg.Syntax.html#StgLit"><span class="hs-identifier hs-var">StgLit</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680953649"><span class="hs-identifier hs-var">f'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-349"></span><span>      </span><span class="annot"><span class="annottext">Maybe UnariseVal
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-350"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953658"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-351"></span><span>
</span><span id="line-352"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span id="local-6989586621680953647"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953647"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span id="local-6989586621680953646"><span class="annot"><span class="annottext">e :: GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953646"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgApp"><span class="hs-identifier hs-type">StgApp</span></a></span><span> </span><span id="local-6989586621680953645"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953645"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621680953644"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953644"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-353"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; [OutStgArg] -&gt; GenStgExpr 'Vanilla
forall (pass :: StgPass). Id -&gt; [OutStgArg] -&gt; GenStgExpr pass
</span><a href="GHC.Stg.Syntax.html#StgApp"><span class="hs-identifier hs-var">StgApp</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953643"><span class="hs-identifier hs-var">f'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnariseEnv -&gt; [OutStgArg] -&gt; [OutStgArg]
</span><a href="GHC.Stg.Unarise.html#unariseFunArgs"><span class="hs-identifier hs-var">unariseFunArgs</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953647"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953644"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-354"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-355"></span><span>    </span><span id="local-6989586621680953643"><span class="annot"><span class="annottext">f' :: Id
</span><a href="#local-6989586621680953643"><span class="hs-identifier hs-var hs-var">f'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; Maybe UnariseVal
forall a. VarEnv a -&gt; Id -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupVarEnv"><span class="hs-identifier hs-var">lookupVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953647"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953645"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-356"></span><span>           </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#UnaryVal"><span class="hs-identifier hs-type">UnaryVal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgVarArg"><span class="hs-identifier hs-type">StgVarArg</span></a></span><span> </span><span id="local-6989586621680953630"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953630"><span class="hs-identifier hs-var">f'</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953630"><span class="hs-identifier hs-var">f'</span></a></span><span>
</span><span id="line-357"></span><span>           </span><span class="annot"><span class="annottext">Maybe UnariseVal
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953645"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-358"></span><span>           </span><span id="local-6989586621680953629"><span class="annot"><span class="annottext">Maybe UnariseVal
</span><a href="#local-6989586621680953629"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; Id
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;unariseExpr - app2&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StgPprOpts -&gt; GenStgExpr 'Vanilla -&gt; SDoc
forall (pass :: StgPass).
OutputablePass pass =&gt;
StgPprOpts -&gt; GenStgExpr pass -&gt; SDoc
</span><a href="GHC.Stg.Syntax.html#pprStgExpr"><span class="hs-identifier hs-var">pprStgExpr</span></a></span><span> </span><span class="annot"><span class="annottext">StgPprOpts
</span><a href="GHC.Stg.Syntax.html#panicStgPprOpts"><span class="hs-identifier hs-var">panicStgPprOpts</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953646"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe UnariseVal -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe UnariseVal
</span><a href="#local-6989586621680953629"><span class="hs-identifier hs-var">err</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-359"></span><span>               </span><span class="hs-comment">-- Can't happen because 'args' is non-empty, and</span><span>
</span><span id="line-360"></span><span>               </span><span class="hs-comment">-- a tuple or sum cannot be applied to anything</span><span>
</span><span id="line-361"></span><span>
</span><span id="line-362"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgLit"><span class="hs-identifier hs-type">StgLit</span></a></span><span> </span><span id="local-6989586621680953624"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680953624"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-363"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Literal -&gt; GenStgExpr 'Vanilla
forall (pass :: StgPass). Literal -&gt; GenStgExpr pass
</span><a href="GHC.Stg.Syntax.html#StgLit"><span class="hs-identifier hs-var">StgLit</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680953624"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-364"></span><span>
</span><span id="line-365"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span id="local-6989586621680953623"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953623"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgConApp"><span class="hs-identifier hs-type">StgConApp</span></a></span><span> </span><span id="local-6989586621680953621"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680953621"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span id="local-6989586621680953620"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953620"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621680953619"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680953619"><span class="hs-identifier hs-var">ty_args</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-366"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680953618"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953618"><span class="hs-identifier hs-var">args'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; DataCon -&gt; [OutStgArg] -&gt; [Type] -&gt; Maybe [OutStgArg]
</span><a href="GHC.Stg.Unarise.html#unariseMulti_maybe"><span class="hs-identifier hs-var">unariseMulti_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953623"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680953621"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953620"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680953619"><span class="hs-identifier hs-var">ty_args</span></a></span><span>
</span><span id="line-367"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OutStgArg] -&gt; GenStgExpr 'Vanilla
</span><a href="GHC.Stg.Unarise.html#mkTuple"><span class="hs-identifier hs-var">mkTuple</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953618"><span class="hs-identifier hs-var">args'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-368"></span><span>
</span><span id="line-369"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-370"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680953616"><span class="annot"><span class="annottext">args' :: [OutStgArg]
</span><a href="#local-6989586621680953616"><span class="hs-identifier hs-var hs-var">args'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; [OutStgArg] -&gt; [OutStgArg]
</span><a href="GHC.Stg.Unarise.html#unariseConArgs"><span class="hs-identifier hs-var">unariseConArgs</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953623"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953620"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-371"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; [OutStgArg] -&gt; [Type] -&gt; GenStgExpr 'Vanilla
forall (pass :: StgPass).
DataCon -&gt; [OutStgArg] -&gt; [Type] -&gt; GenStgExpr pass
</span><a href="GHC.Stg.Syntax.html#StgConApp"><span class="hs-identifier hs-var">StgConApp</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680953621"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953616"><span class="hs-identifier hs-var">args'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(OutStgArg -&gt; Type) -&gt; [OutStgArg] -&gt; [Type]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">OutStgArg -&gt; Type
</span><a href="GHC.Stg.Syntax.html#stgArgType"><span class="hs-identifier hs-var">stgArgType</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953616"><span class="hs-identifier hs-var">args'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-372"></span><span>
</span><span id="line-373"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span id="local-6989586621680953615"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953615"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgOpApp"><span class="hs-identifier hs-type">StgOpApp</span></a></span><span> </span><span id="local-6989586621680953613"><span class="annot"><span class="annottext">StgOp
</span><a href="#local-6989586621680953613"><span class="hs-identifier hs-var">op</span></a></span></span><span> </span><span id="local-6989586621680953612"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953612"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621680953611"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680953611"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-374"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StgOp -&gt; [OutStgArg] -&gt; Type -&gt; GenStgExpr 'Vanilla
forall (pass :: StgPass).
StgOp -&gt; [OutStgArg] -&gt; Type -&gt; GenStgExpr pass
</span><a href="GHC.Stg.Syntax.html#StgOpApp"><span class="hs-identifier hs-var">StgOpApp</span></a></span><span> </span><span class="annot"><span class="annottext">StgOp
</span><a href="#local-6989586621680953613"><span class="hs-identifier hs-var">op</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnariseEnv -&gt; [OutStgArg] -&gt; [OutStgArg]
</span><a href="GHC.Stg.Unarise.html#unariseFunArgs"><span class="hs-identifier hs-var">unariseFunArgs</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953615"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953612"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680953611"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-375"></span><span>
</span><span id="line-376"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680953610"><span class="annot"><span class="annottext">e :: GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953610"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgLam"><span class="hs-identifier hs-type">StgLam</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>
</span><span id="line-377"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; UniqSM (GenStgExpr 'Vanilla)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;unariseExpr: found lambda&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StgPprOpts -&gt; GenStgExpr 'Vanilla -&gt; SDoc
forall (pass :: StgPass).
OutputablePass pass =&gt;
StgPprOpts -&gt; GenStgExpr pass -&gt; SDoc
</span><a href="GHC.Stg.Syntax.html#pprStgExpr"><span class="hs-identifier hs-var">pprStgExpr</span></a></span><span> </span><span class="annot"><span class="annottext">StgPprOpts
</span><a href="GHC.Stg.Syntax.html#panicStgPprOpts"><span class="hs-identifier hs-var">panicStgPprOpts</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953610"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-378"></span><span>
</span><span id="line-379"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span id="local-6989586621680953608"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953608"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgCase"><span class="hs-identifier hs-type">StgCase</span></a></span><span> </span><span id="local-6989586621680953606"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953606"><span class="hs-identifier hs-var">scrut</span></a></span></span><span> </span><span id="local-6989586621680953605"><span class="annot"><span class="annottext">BinderP 'Vanilla
</span><a href="#local-6989586621680953605"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span id="local-6989586621680953604"><span class="annot"><span class="annottext">AltType
</span><a href="#local-6989586621680953604"><span class="hs-identifier hs-var">alt_ty</span></a></span></span><span> </span><span id="local-6989586621680953603"><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953603"><span class="hs-identifier hs-var">alts</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-380"></span><span>  </span><span class="hs-comment">-- tuple/sum binders in the scrutinee can always be eliminated</span><span>
</span><span id="line-381"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgApp"><span class="hs-identifier hs-type">StgApp</span></a></span><span> </span><span id="local-6989586621680953602"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953602"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953606"><span class="hs-identifier hs-var">scrut</span></a></span><span>
</span><span id="line-382"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#MultiVal"><span class="hs-identifier hs-type">MultiVal</span></a></span><span> </span><span id="local-6989586621680953601"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953601"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; Maybe UnariseVal
forall a. VarEnv a -&gt; Id -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupVarEnv"><span class="hs-identifier hs-var">lookupVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953608"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953602"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-383"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnariseEnv
-&gt; [OutStgArg]
-&gt; Id
-&gt; AltType
-&gt; [GenStgAlt 'Vanilla]
-&gt; UniqSM (GenStgExpr 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#elimCase"><span class="hs-identifier hs-var">elimCase</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953608"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953601"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">Id
BinderP 'Vanilla
</span><a href="#local-6989586621680953605"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">AltType
</span><a href="#local-6989586621680953604"><span class="hs-identifier hs-var">alt_ty</span></a></span><span> </span><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953603"><span class="hs-identifier hs-var">alts</span></a></span><span>
</span><span id="line-384"></span><span>
</span><span id="line-385"></span><span>  </span><span class="hs-comment">-- Handle strict lets for tuples and sums:</span><span>
</span><span id="line-386"></span><span>  </span><span class="hs-comment">--   case (# a,b #) of r -&gt; rhs</span><span>
</span><span id="line-387"></span><span>  </span><span class="hs-comment">-- and analogously for sums</span><span>
</span><span id="line-388"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgConApp"><span class="hs-identifier hs-type">StgConApp</span></a></span><span> </span><span id="local-6989586621680953599"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680953599"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span id="local-6989586621680953598"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953598"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621680953597"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680953597"><span class="hs-identifier hs-var">ty_args</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953606"><span class="hs-identifier hs-var">scrut</span></a></span><span>
</span><span id="line-389"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680953596"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953596"><span class="hs-identifier hs-var">args'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; DataCon -&gt; [OutStgArg] -&gt; [Type] -&gt; Maybe [OutStgArg]
</span><a href="GHC.Stg.Unarise.html#unariseMulti_maybe"><span class="hs-identifier hs-var">unariseMulti_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953608"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680953599"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953598"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680953597"><span class="hs-identifier hs-var">ty_args</span></a></span><span>
</span><span id="line-390"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnariseEnv
-&gt; [OutStgArg]
-&gt; Id
-&gt; AltType
-&gt; [GenStgAlt 'Vanilla]
-&gt; UniqSM (GenStgExpr 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#elimCase"><span class="hs-identifier hs-var">elimCase</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953608"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953596"><span class="hs-identifier hs-var">args'</span></a></span><span> </span><span class="annot"><span class="annottext">Id
BinderP 'Vanilla
</span><a href="#local-6989586621680953605"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">AltType
</span><a href="#local-6989586621680953604"><span class="hs-identifier hs-var">alt_ty</span></a></span><span> </span><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953603"><span class="hs-identifier hs-var">alts</span></a></span><span>
</span><span id="line-391"></span><span>
</span><span id="line-392"></span><span>  </span><span class="hs-comment">-- general case</span><span>
</span><span id="line-393"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-394"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621680953595"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953595"><span class="hs-identifier hs-var">scrut'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953608"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953606"><span class="hs-identifier hs-var">scrut</span></a></span><span>
</span><span id="line-395"></span><span>       </span><span id="local-6989586621680953594"><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
</span><a href="#local-6989586621680953594"><span class="hs-identifier hs-var">alts'</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnariseEnv
-&gt; AltType
-&gt; Id
-&gt; [GenStgAlt 'Vanilla]
-&gt; UniqSM [GenStgAlt 'Vanilla]
</span><a href="GHC.Stg.Unarise.html#unariseAlts"><span class="hs-identifier hs-var">unariseAlts</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953608"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">AltType
</span><a href="#local-6989586621680953604"><span class="hs-identifier hs-var">alt_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Id
BinderP 'Vanilla
</span><a href="#local-6989586621680953605"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953603"><span class="hs-identifier hs-var">alts</span></a></span><span>
</span><span id="line-396"></span><span>       </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
-&gt; BinderP 'Vanilla
-&gt; AltType
-&gt; [GenStgAlt 'Vanilla]
-&gt; GenStgExpr 'Vanilla
forall (pass :: StgPass).
GenStgExpr pass
-&gt; BinderP pass -&gt; AltType -&gt; [GenStgAlt pass] -&gt; GenStgExpr pass
</span><a href="GHC.Stg.Syntax.html#StgCase"><span class="hs-identifier hs-var">StgCase</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953595"><span class="hs-identifier hs-var">scrut'</span></a></span><span> </span><span class="annot"><span class="annottext">BinderP 'Vanilla
</span><a href="#local-6989586621680953605"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">AltType
</span><a href="#local-6989586621680953604"><span class="hs-identifier hs-var">alt_ty</span></a></span><span> </span><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953594"><span class="hs-identifier hs-var">alts'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-397"></span><span>                       </span><span class="hs-comment">-- bndr may have a unboxed sum/tuple type but it will be</span><span>
</span><span id="line-398"></span><span>                       </span><span class="hs-comment">-- dead after unarise (checked in GHC.Stg.Lint)</span><span>
</span><span id="line-399"></span><span>
</span><span id="line-400"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span id="local-6989586621680953592"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953592"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgLet"><span class="hs-identifier hs-type">StgLet</span></a></span><span> </span><span id="local-6989586621680953590"><span class="annot"><span class="annottext">XLet 'Vanilla
</span><a href="#local-6989586621680953590"><span class="hs-identifier hs-var">ext</span></a></span></span><span> </span><span id="local-6989586621680953589"><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680953589"><span class="hs-identifier hs-var">bind</span></a></span></span><span> </span><span id="local-6989586621680953588"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953588"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-401"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">XLet 'Vanilla
-&gt; GenStgBinding 'Vanilla
-&gt; GenStgExpr 'Vanilla
-&gt; GenStgExpr 'Vanilla
forall (pass :: StgPass).
XLet pass
-&gt; GenStgBinding pass -&gt; GenStgExpr pass -&gt; GenStgExpr pass
</span><a href="GHC.Stg.Syntax.html#StgLet"><span class="hs-identifier hs-var">StgLet</span></a></span><span> </span><span class="annot"><span class="annottext">XLet 'Vanilla
</span><a href="#local-6989586621680953590"><span class="hs-identifier hs-var">ext</span></a></span><span> </span><span class="annot"><span class="annottext">(GenStgBinding 'Vanilla
 -&gt; GenStgExpr 'Vanilla -&gt; GenStgExpr 'Vanilla)
-&gt; UniqSM (GenStgBinding 'Vanilla)
-&gt; UniqSM (GenStgExpr 'Vanilla -&gt; GenStgExpr 'Vanilla)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
-&gt; GenStgBinding 'Vanilla -&gt; UniqSM (GenStgBinding 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseBinding"><span class="hs-identifier hs-var">unariseBinding</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953592"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680953589"><span class="hs-identifier hs-var">bind</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSM (GenStgExpr 'Vanilla -&gt; GenStgExpr 'Vanilla)
-&gt; UniqSM (GenStgExpr 'Vanilla) -&gt; UniqSM (GenStgExpr 'Vanilla)
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953592"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953588"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-402"></span><span>
</span><span id="line-403"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span id="local-6989586621680953587"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953587"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgLetNoEscape"><span class="hs-identifier hs-type">StgLetNoEscape</span></a></span><span> </span><span id="local-6989586621680953585"><span class="annot"><span class="annottext">XLetNoEscape 'Vanilla
</span><a href="#local-6989586621680953585"><span class="hs-identifier hs-var">ext</span></a></span></span><span> </span><span id="local-6989586621680953584"><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680953584"><span class="hs-identifier hs-var">bind</span></a></span></span><span> </span><span id="local-6989586621680953583"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953583"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-404"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">XLetNoEscape 'Vanilla
-&gt; GenStgBinding 'Vanilla
-&gt; GenStgExpr 'Vanilla
-&gt; GenStgExpr 'Vanilla
forall (pass :: StgPass).
XLetNoEscape pass
-&gt; GenStgBinding pass -&gt; GenStgExpr pass -&gt; GenStgExpr pass
</span><a href="GHC.Stg.Syntax.html#StgLetNoEscape"><span class="hs-identifier hs-var">StgLetNoEscape</span></a></span><span> </span><span class="annot"><span class="annottext">XLetNoEscape 'Vanilla
</span><a href="#local-6989586621680953585"><span class="hs-identifier hs-var">ext</span></a></span><span> </span><span class="annot"><span class="annottext">(GenStgBinding 'Vanilla
 -&gt; GenStgExpr 'Vanilla -&gt; GenStgExpr 'Vanilla)
-&gt; UniqSM (GenStgBinding 'Vanilla)
-&gt; UniqSM (GenStgExpr 'Vanilla -&gt; GenStgExpr 'Vanilla)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
-&gt; GenStgBinding 'Vanilla -&gt; UniqSM (GenStgBinding 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseBinding"><span class="hs-identifier hs-var">unariseBinding</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953587"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680953584"><span class="hs-identifier hs-var">bind</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSM (GenStgExpr 'Vanilla -&gt; GenStgExpr 'Vanilla)
-&gt; UniqSM (GenStgExpr 'Vanilla) -&gt; UniqSM (GenStgExpr 'Vanilla)
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953587"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953583"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-405"></span><span>
</span><span id="line-406"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span id="local-6989586621680953582"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953582"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTick"><span class="hs-identifier hs-type">StgTick</span></a></span><span> </span><span id="local-6989586621680953580"><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621680953580"><span class="hs-identifier hs-var">tick</span></a></span></span><span> </span><span id="local-6989586621680953579"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953579"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-407"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; GenStgExpr 'Vanilla -&gt; GenStgExpr 'Vanilla
forall (pass :: StgPass).
Tickish Id -&gt; GenStgExpr pass -&gt; GenStgExpr pass
</span><a href="GHC.Stg.Syntax.html#StgTick"><span class="hs-identifier hs-var">StgTick</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621680953580"><span class="hs-identifier hs-var">tick</span></a></span><span> </span><span class="annot"><span class="annottext">(GenStgExpr 'Vanilla -&gt; GenStgExpr 'Vanilla)
-&gt; UniqSM (GenStgExpr 'Vanilla) -&gt; UniqSM (GenStgExpr 'Vanilla)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953582"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953579"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-408"></span><span>
</span><span id="line-409"></span><span class="hs-comment">-- Doesn't return void args.</span><span>
</span><span id="line-410"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseMulti_maybe"><span class="hs-identifier hs-type">unariseMulti_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#InStgArg"><span class="hs-identifier hs-type">InStgArg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#OutStgArg"><span class="hs-identifier hs-type">OutStgArg</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-411"></span><span id="unariseMulti_maybe"><span class="annot"><span class="annottext">unariseMulti_maybe :: UnariseEnv -&gt; DataCon -&gt; [OutStgArg] -&gt; [Type] -&gt; Maybe [OutStgArg]
</span><a href="GHC.Stg.Unarise.html#unariseMulti_maybe"><span class="hs-identifier hs-var hs-var">unariseMulti_maybe</span></a></span></span><span> </span><span id="local-6989586621680953577"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953577"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span id="local-6989586621680953576"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680953576"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span id="local-6989586621680953575"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953575"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621680953574"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680953574"><span class="hs-identifier hs-var">ty_args</span></a></span></span><span>
</span><span id="line-412"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Bool
</span><a href="GHC.Core.DataCon.html#isUnboxedTupleCon"><span class="hs-identifier hs-var">isUnboxedTupleCon</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680953576"><span class="hs-identifier hs-var">dc</span></a></span><span>
</span><span id="line-413"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[OutStgArg] -&gt; Maybe [OutStgArg]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnariseEnv -&gt; [OutStgArg] -&gt; [OutStgArg]
</span><a href="GHC.Stg.Unarise.html#unariseConArgs"><span class="hs-identifier hs-var">unariseConArgs</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953577"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953575"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-414"></span><span>
</span><span id="line-415"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Bool
</span><a href="GHC.Core.DataCon.html#isUnboxedSumCon"><span class="hs-identifier hs-var">isUnboxedSumCon</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680953576"><span class="hs-identifier hs-var">dc</span></a></span><span>
</span><span id="line-416"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680953573"><span class="annot"><span class="annottext">args1 :: [OutStgArg]
</span><a href="#local-6989586621680953573"><span class="hs-identifier hs-var hs-var">args1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">isSingleton</span><span> </span><span class="hs-identifier">args</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">unariseConArgs</span><span> </span><span class="hs-identifier">rho</span><span> </span><span class="hs-identifier">args</span><span class="hs-special">)</span><span>
</span><span id="line-417"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[OutStgArg] -&gt; Maybe [OutStgArg]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; [Type] -&gt; [OutStgArg] -&gt; [OutStgArg]
</span><a href="GHC.Stg.Unarise.html#mkUbxSum"><span class="hs-identifier hs-var">mkUbxSum</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680953576"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680953574"><span class="hs-identifier hs-var">ty_args</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953573"><span class="hs-identifier hs-var">args1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-418"></span><span>
</span><span id="line-419"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-420"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe [OutStgArg]
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-421"></span><span>
</span><span id="line-422"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-423"></span><span>
</span><span id="line-424"></span><span class="annot"><a href="GHC.Stg.Unarise.html#elimCase"><span class="hs-identifier hs-type">elimCase</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span>
</span><span id="line-425"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#OutStgArg"><span class="hs-identifier hs-type">OutStgArg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- non-void args</span><span>
</span><span id="line-426"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#InId"><span class="hs-identifier hs-type">InId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#AltType"><span class="hs-identifier hs-type">AltType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#InStgAlt"><span class="hs-identifier hs-type">InStgAlt</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#OutStgExpr"><span class="hs-identifier hs-type">OutStgExpr</span></a></span><span>
</span><span id="line-427"></span><span>
</span><span id="line-428"></span><span id="elimCase"><span class="annot"><span class="annottext">elimCase :: UnariseEnv
-&gt; [OutStgArg]
-&gt; Id
-&gt; AltType
-&gt; [GenStgAlt 'Vanilla]
-&gt; UniqSM (GenStgExpr 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#elimCase"><span class="hs-identifier hs-var hs-var">elimCase</span></a></span></span><span> </span><span id="local-6989586621680953567"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953567"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span id="local-6989586621680953566"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953566"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621680953565"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953565"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#MultiValAlt"><span class="hs-identifier hs-type">MultiValAlt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">AltCon
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953563"><span class="annot"><span class="annottext">[BinderP 'Vanilla]
</span><a href="#local-6989586621680953563"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953562"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953562"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-429"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680953561"><span class="annot"><span class="annottext">rho1 :: UnariseEnv
</span><a href="#local-6989586621680953561"><span class="hs-identifier hs-var hs-var">rho1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; UnariseVal -&gt; UnariseEnv
</span><a href="GHC.Stg.Unarise.html#extendRho"><span class="hs-identifier hs-var">extendRho</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953567"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953565"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OutStgArg] -&gt; UnariseVal
</span><a href="GHC.Stg.Unarise.html#MultiVal"><span class="hs-identifier hs-var">MultiVal</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953566"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-430"></span><span>           </span><span id="local-6989586621680953559"><span class="annot"><span class="annottext">rho2 :: UnariseEnv
</span><a href="#local-6989586621680953559"><span class="hs-identifier hs-var hs-var">rho2</span></a></span></span><span>
</span><span id="line-431"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Stg.Unarise.html#isUnboxedTupleBndr"><span class="hs-identifier hs-var">isUnboxedTupleBndr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953565"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-432"></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; [OutStgArg] -&gt; UnariseEnv -&gt; UnariseEnv
</span><a href="GHC.Stg.Unarise.html#mapTupleIdBinders"><span class="hs-identifier hs-var">mapTupleIdBinders</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[BinderP 'Vanilla]
</span><a href="#local-6989586621680953563"><span class="hs-identifier hs-var">bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953566"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953561"><span class="hs-identifier hs-var">rho1</span></a></span><span>
</span><span id="line-433"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-434"></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">isUnboxedSumBndr</span><span> </span><span class="hs-identifier">bndr</span><span class="hs-special">)</span><span>
</span><span id="line-435"></span><span>               </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[BinderP 'Vanilla]
</span><a href="#local-6989586621680953563"><span class="hs-identifier hs-var">bndrs</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953561"><span class="hs-identifier hs-var">rho1</span></a></span><span>
</span><span id="line-436"></span><span>                             </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; [OutStgArg] -&gt; UnariseEnv -&gt; UnariseEnv
</span><a href="GHC.Stg.Unarise.html#mapSumIdBinders"><span class="hs-identifier hs-var">mapSumIdBinders</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[BinderP 'Vanilla]
</span><a href="#local-6989586621680953563"><span class="hs-identifier hs-var">bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953566"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953561"><span class="hs-identifier hs-var">rho1</span></a></span><span>
</span><span id="line-437"></span><span>
</span><span id="line-438"></span><span>       </span><span class="annot"><span class="annottext">UnariseEnv -&gt; GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953559"><span class="hs-identifier hs-var">rho2</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953562"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-439"></span><span>
</span><span id="line-440"></span><span class="annot"><a href="GHC.Stg.Unarise.html#elimCase"><span class="hs-identifier hs-var">elimCase</span></a></span><span> </span><span id="local-6989586621680953553"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953553"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span id="local-6989586621680953552"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953552"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621680953551"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953551"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#MultiValAlt"><span class="hs-identifier hs-type">MultiValAlt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680953550"><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953550"><span class="hs-identifier hs-var">alts</span></a></span></span><span>
</span><span id="line-441"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Stg.Unarise.html#isUnboxedSumBndr"><span class="hs-identifier hs-var">isUnboxedSumBndr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953551"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-442"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680953549"><span class="annot"><span class="annottext">OutStgArg
</span><a href="#local-6989586621680953549"><span class="hs-identifier hs-var">tag_arg</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680953548"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953548"><span class="hs-identifier hs-var">real_args</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953552"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-443"></span><span>       </span><span id="local-6989586621680953547"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953547"><span class="hs-identifier hs-var">tag_bndr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Type -&gt; UniqSM Id
</span><a href="GHC.Stg.Unarise.html#mkId"><span class="hs-identifier hs-var">mkId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tag&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Stg.Unarise.html#tagTy"><span class="hs-identifier hs-var">tagTy</span></a></span><span>
</span><span id="line-444"></span><span>          </span><span class="hs-comment">-- this won't be used but we need a binder anyway</span><span>
</span><span id="line-445"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680953544"><span class="annot"><span class="annottext">rho1 :: UnariseEnv
</span><a href="#local-6989586621680953544"><span class="hs-identifier hs-var hs-var">rho1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; UnariseVal -&gt; UnariseEnv
</span><a href="GHC.Stg.Unarise.html#extendRho"><span class="hs-identifier hs-var">extendRho</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953553"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953551"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OutStgArg] -&gt; UnariseVal
</span><a href="GHC.Stg.Unarise.html#MultiVal"><span class="hs-identifier hs-var">MultiVal</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953552"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-446"></span><span>           </span><span id="local-6989586621680953543"><span class="annot"><span class="annottext">scrut' :: GenStgExpr pass
</span><a href="#local-6989586621680953543"><span class="hs-identifier hs-var hs-var">scrut'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">OutStgArg
</span><a href="#local-6989586621680953549"><span class="hs-identifier hs-var">tag_arg</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-447"></span><span>                      </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgVarArg"><span class="hs-identifier hs-type">StgVarArg</span></a></span><span> </span><span id="local-6989586621680953542"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953542"><span class="hs-identifier hs-var">v</span></a></span></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Id -&gt; [OutStgArg] -&gt; GenStgExpr pass
forall (pass :: StgPass). Id -&gt; [OutStgArg] -&gt; GenStgExpr pass
</span><a href="GHC.Stg.Syntax.html#StgApp"><span class="hs-identifier hs-var">StgApp</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953542"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-448"></span><span>                      </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgLitArg"><span class="hs-identifier hs-type">StgLitArg</span></a></span><span> </span><span id="local-6989586621680953541"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680953541"><span class="hs-identifier hs-var">l</span></a></span></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Literal -&gt; GenStgExpr pass
forall (pass :: StgPass). Literal -&gt; GenStgExpr pass
</span><a href="GHC.Stg.Syntax.html#StgLit"><span class="hs-identifier hs-var">StgLit</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680953541"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-449"></span><span>
</span><span id="line-450"></span><span>       </span><span id="local-6989586621680953540"><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
</span><a href="#local-6989586621680953540"><span class="hs-identifier hs-var">alts'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnariseEnv
-&gt; [OutStgArg]
-&gt; [GenStgAlt 'Vanilla]
-&gt; UniqSM [GenStgAlt 'Vanilla]
</span><a href="GHC.Stg.Unarise.html#unariseSumAlts"><span class="hs-identifier hs-var">unariseSumAlts</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953544"><span class="hs-identifier hs-var">rho1</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953548"><span class="hs-identifier hs-var">real_args</span></a></span><span> </span><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953550"><span class="hs-identifier hs-var">alts</span></a></span><span>
</span><span id="line-451"></span><span>       </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
-&gt; BinderP 'Vanilla
-&gt; AltType
-&gt; [GenStgAlt 'Vanilla]
-&gt; GenStgExpr 'Vanilla
forall (pass :: StgPass).
GenStgExpr pass
-&gt; BinderP pass -&gt; AltType -&gt; [GenStgAlt pass] -&gt; GenStgExpr pass
</span><a href="GHC.Stg.Syntax.html#StgCase"><span class="hs-identifier hs-var">StgCase</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
forall {pass :: StgPass}. GenStgExpr pass
</span><a href="#local-6989586621680953543"><span class="hs-identifier hs-var">scrut'</span></a></span><span> </span><span class="annot"><span class="annottext">Id
BinderP 'Vanilla
</span><a href="#local-6989586621680953547"><span class="hs-identifier hs-var">tag_bndr</span></a></span><span> </span><span class="annot"><span class="annottext">AltType
</span><a href="GHC.Stg.Unarise.html#tagAltTy"><span class="hs-identifier hs-var">tagAltTy</span></a></span><span> </span><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953540"><span class="hs-identifier hs-var">alts'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-452"></span><span>
</span><span id="line-453"></span><span class="annot"><a href="GHC.Stg.Unarise.html#elimCase"><span class="hs-identifier hs-var">elimCase</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680953537"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953537"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621680953536"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953536"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span id="local-6989586621680953535"><span class="annot"><span class="annottext">AltType
</span><a href="#local-6989586621680953535"><span class="hs-identifier hs-var">alt_ty</span></a></span></span><span> </span><span id="local-6989586621680953534"><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953534"><span class="hs-identifier hs-var">alts</span></a></span></span><span>
</span><span id="line-454"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; UniqSM (GenStgExpr 'Vanilla)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;elimCase - unhandled case&quot;</span></span><span>
</span><span id="line-455"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OutStgArg] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953537"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953536"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">AltType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">AltType
</span><a href="#local-6989586621680953535"><span class="hs-identifier hs-var">alt_ty</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)] -&gt; SDoc
forall a b (pass :: StgPass).
(Outputable a, Outputable b, OutputablePass pass) =&gt;
[(a, b, GenStgExpr pass)] -&gt; SDoc
</span><a href="GHC.Stg.Unarise.html#pprPanicAlts"><span class="hs-identifier hs-var">pprPanicAlts</span></a></span><span> </span><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953534"><span class="hs-identifier hs-var">alts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-456"></span><span>
</span><span id="line-457"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-458"></span><span>
</span><span id="line-459"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseAlts"><span class="hs-identifier hs-type">unariseAlts</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#AltType"><span class="hs-identifier hs-type">AltType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#InId"><span class="hs-identifier hs-type">InId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgAlt"><span class="hs-identifier hs-type">StgAlt</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgAlt"><span class="hs-identifier hs-type">StgAlt</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-460"></span><span id="unariseAlts"><span class="annot"><span class="annottext">unariseAlts :: UnariseEnv
-&gt; AltType
-&gt; Id
-&gt; [GenStgAlt 'Vanilla]
-&gt; UniqSM [GenStgAlt 'Vanilla]
</span><a href="GHC.Stg.Unarise.html#unariseAlts"><span class="hs-identifier hs-var hs-var">unariseAlts</span></a></span></span><span> </span><span id="local-6989586621680953531"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953531"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#MultiValAlt"><span class="hs-identifier hs-type">MultiValAlt</span></a></span><span> </span><span id="local-6989586621680953530"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680953530"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680953529"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953529"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">AltCon
</span><a href="GHC.Core.html#DEFAULT"><span class="hs-identifier hs-var">DEFAULT</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953527"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953527"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-461"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Stg.Unarise.html#isUnboxedTupleBndr"><span class="hs-identifier hs-var">isUnboxedTupleBndr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953529"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-462"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680953526"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953526"><span class="hs-identifier hs-var">rho'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953525"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953525"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; UniqSM (UnariseEnv, [Id])
</span><a href="GHC.Stg.Unarise.html#unariseConArgBinder"><span class="hs-identifier hs-var">unariseConArgBinder</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953531"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953529"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-463"></span><span>       </span><span id="local-6989586621680953523"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953523"><span class="hs-identifier hs-var">e'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953526"><span class="hs-identifier hs-var">rho'</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953527"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-464"></span><span>       </span><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
-&gt; UniqSM [(AltCon, [Id], GenStgExpr 'Vanilla)]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; AltCon
</span><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-var">DataAlt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Boxity -&gt; Int -&gt; DataCon
</span><a href="GHC.Builtin.Types.html#tupleDataCon"><span class="hs-identifier hs-var">tupleDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><a href="GHC.Types.Basic.html#Unboxed"><span class="hs-identifier hs-var">Unboxed</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680953530"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953525"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953523"><span class="hs-identifier hs-var">e'</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-465"></span><span>
</span><span id="line-466"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseAlts"><span class="hs-identifier hs-var">unariseAlts</span></a></span><span> </span><span id="local-6989586621680953519"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953519"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#MultiValAlt"><span class="hs-identifier hs-type">MultiValAlt</span></a></span><span> </span><span id="local-6989586621680953518"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680953518"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680953517"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953517"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-type">DataAlt</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953516"><span class="annot"><span class="annottext">[BinderP 'Vanilla]
</span><a href="#local-6989586621680953516"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953515"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953515"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-467"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Stg.Unarise.html#isUnboxedTupleBndr"><span class="hs-identifier hs-var">isUnboxedTupleBndr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953517"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-468"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680953514"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953514"><span class="hs-identifier hs-var">rho'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953513"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953513"><span class="hs-identifier hs-var">ys1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; [Id] -&gt; UniqSM (UnariseEnv, [Id])
</span><a href="GHC.Stg.Unarise.html#unariseConArgBinders"><span class="hs-identifier hs-var">unariseConArgBinders</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953519"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[BinderP 'Vanilla]
</span><a href="#local-6989586621680953516"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-469"></span><span>       </span><span class="hs-identifier">MASSERT</span><span class="hs-special">(</span><span class="hs-identifier">ys1</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">lengthIs</span><span class="hs-special">`</span><span> </span><span class="hs-identifier">n</span><span class="hs-special">)</span><span>
</span><span id="line-470"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680953510"><span class="annot"><span class="annottext">rho'' :: UnariseEnv
</span><a href="#local-6989586621680953510"><span class="hs-identifier hs-var hs-var">rho''</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; UnariseVal -&gt; UnariseEnv
</span><a href="GHC.Stg.Unarise.html#extendRho"><span class="hs-identifier hs-var">extendRho</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953514"><span class="hs-identifier hs-var">rho'</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953517"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OutStgArg] -&gt; UnariseVal
</span><a href="GHC.Stg.Unarise.html#MultiVal"><span class="hs-identifier hs-var">MultiVal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; OutStgArg) -&gt; [Id] -&gt; [OutStgArg]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; OutStgArg
</span><a href="GHC.Stg.Syntax.html#StgVarArg"><span class="hs-identifier hs-var">StgVarArg</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953513"><span class="hs-identifier hs-var">ys1</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-471"></span><span>       </span><span id="local-6989586621680953509"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953509"><span class="hs-identifier hs-var">e'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953510"><span class="hs-identifier hs-var">rho''</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953515"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-472"></span><span>       </span><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
-&gt; UniqSM [(AltCon, [Id], GenStgExpr 'Vanilla)]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; AltCon
</span><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-var">DataAlt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Boxity -&gt; Int -&gt; DataCon
</span><a href="GHC.Builtin.Types.html#tupleDataCon"><span class="hs-identifier hs-var">tupleDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><a href="GHC.Types.Basic.html#Unboxed"><span class="hs-identifier hs-var">Unboxed</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680953518"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953513"><span class="hs-identifier hs-var">ys1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953509"><span class="hs-identifier hs-var">e'</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-473"></span><span>
</span><span id="line-474"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseAlts"><span class="hs-identifier hs-var">unariseAlts</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#MultiValAlt"><span class="hs-identifier hs-type">MultiValAlt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680953508"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953508"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span id="local-6989586621680953507"><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953507"><span class="hs-identifier hs-var">alts</span></a></span></span><span>
</span><span id="line-475"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Stg.Unarise.html#isUnboxedTupleBndr"><span class="hs-identifier hs-var">isUnboxedTupleBndr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953508"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-476"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; UniqSM [(AltCon, [Id], GenStgExpr 'Vanilla)]
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;unariseExpr: strange multi val alts&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)] -&gt; SDoc
forall a b (pass :: StgPass).
(Outputable a, Outputable b, OutputablePass pass) =&gt;
[(a, b, GenStgExpr pass)] -&gt; SDoc
</span><a href="GHC.Stg.Unarise.html#pprPanicAlts"><span class="hs-identifier hs-var">pprPanicAlts</span></a></span><span> </span><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953507"><span class="hs-identifier hs-var">alts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-477"></span><span>
</span><span id="line-478"></span><span class="hs-comment">-- In this case we don't need to scrutinize the tag bit</span><span>
</span><span id="line-479"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseAlts"><span class="hs-identifier hs-var">unariseAlts</span></a></span><span> </span><span id="local-6989586621680953506"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953506"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#MultiValAlt"><span class="hs-identifier hs-type">MultiValAlt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680953505"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953505"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">AltCon
</span><a href="GHC.Core.html#DEFAULT"><span class="hs-identifier hs-var">DEFAULT</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[BinderP 'Vanilla]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953504"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953504"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-480"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Stg.Unarise.html#isUnboxedSumBndr"><span class="hs-identifier hs-var">isUnboxedSumBndr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953505"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-481"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680953503"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953503"><span class="hs-identifier hs-var">rho_sum_bndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953502"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953502"><span class="hs-identifier hs-var">sum_bndrs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; UniqSM (UnariseEnv, [Id])
</span><a href="GHC.Stg.Unarise.html#unariseConArgBinder"><span class="hs-identifier hs-var">unariseConArgBinder</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953506"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953505"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-482"></span><span>       </span><span id="local-6989586621680953501"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953501"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953503"><span class="hs-identifier hs-var">rho_sum_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953504"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-483"></span><span>       </span><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
-&gt; UniqSM [(AltCon, [Id], GenStgExpr 'Vanilla)]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; AltCon
</span><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-var">DataAlt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Boxity -&gt; Int -&gt; DataCon
</span><a href="GHC.Builtin.Types.html#tupleDataCon"><span class="hs-identifier hs-var">tupleDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><a href="GHC.Types.Basic.html#Unboxed"><span class="hs-identifier hs-var">Unboxed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953502"><span class="hs-identifier hs-var">sum_bndrs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953502"><span class="hs-identifier hs-var">sum_bndrs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953501"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-484"></span><span>
</span><span id="line-485"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseAlts"><span class="hs-identifier hs-var">unariseAlts</span></a></span><span> </span><span id="local-6989586621680953499"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953499"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#MultiValAlt"><span class="hs-identifier hs-type">MultiValAlt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680953498"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953498"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span id="local-6989586621680953497"><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953497"><span class="hs-identifier hs-var">alts</span></a></span></span><span>
</span><span id="line-486"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Stg.Unarise.html#isUnboxedSumBndr"><span class="hs-identifier hs-var">isUnboxedSumBndr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953498"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-487"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680953496"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953496"><span class="hs-identifier hs-var">rho_sum_bndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953495"><span class="annot"><span class="annottext">scrt_bndrs :: [Id]
</span><a href="#local-6989586621680953495"><span class="hs-identifier hs-var">scrt_bndrs</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621680953494"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953494"><span class="hs-identifier hs-var">tag_bndr</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680953493"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953493"><span class="hs-identifier hs-var">real_bndrs</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; UniqSM (UnariseEnv, [Id])
</span><a href="GHC.Stg.Unarise.html#unariseConArgBinder"><span class="hs-identifier hs-var">unariseConArgBinder</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953499"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953498"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-488"></span><span>       </span><span id="local-6989586621680953492"><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
</span><a href="#local-6989586621680953492"><span class="hs-identifier hs-var">alts'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnariseEnv
-&gt; [OutStgArg]
-&gt; [GenStgAlt 'Vanilla]
-&gt; UniqSM [GenStgAlt 'Vanilla]
</span><a href="GHC.Stg.Unarise.html#unariseSumAlts"><span class="hs-identifier hs-var">unariseSumAlts</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953496"><span class="hs-identifier hs-var">rho_sum_bndrs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; OutStgArg) -&gt; [Id] -&gt; [OutStgArg]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; OutStgArg
</span><a href="GHC.Stg.Syntax.html#StgVarArg"><span class="hs-identifier hs-var">StgVarArg</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953493"><span class="hs-identifier hs-var">real_bndrs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953497"><span class="hs-identifier hs-var">alts</span></a></span><span>
</span><span id="line-489"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680953491"><span class="annot"><span class="annottext">inner_case :: GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953491"><span class="hs-identifier hs-var hs-var">inner_case</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
-&gt; BinderP 'Vanilla
-&gt; AltType
-&gt; [GenStgAlt 'Vanilla]
-&gt; GenStgExpr 'Vanilla
forall (pass :: StgPass).
GenStgExpr pass
-&gt; BinderP pass -&gt; AltType -&gt; [GenStgAlt pass] -&gt; GenStgExpr pass
</span><a href="GHC.Stg.Syntax.html#StgCase"><span class="hs-identifier hs-var">StgCase</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; [OutStgArg] -&gt; GenStgExpr 'Vanilla
forall (pass :: StgPass). Id -&gt; [OutStgArg] -&gt; GenStgExpr pass
</span><a href="GHC.Stg.Syntax.html#StgApp"><span class="hs-identifier hs-var">StgApp</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953494"><span class="hs-identifier hs-var">tag_bndr</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
BinderP 'Vanilla
</span><a href="#local-6989586621680953494"><span class="hs-identifier hs-var">tag_bndr</span></a></span><span> </span><span class="annot"><span class="annottext">AltType
</span><a href="GHC.Stg.Unarise.html#tagAltTy"><span class="hs-identifier hs-var">tagAltTy</span></a></span><span> </span><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953492"><span class="hs-identifier hs-var">alts'</span></a></span><span>
</span><span id="line-490"></span><span>       </span><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
-&gt; UniqSM [(AltCon, [Id], GenStgExpr 'Vanilla)]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; AltCon
</span><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-var">DataAlt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Boxity -&gt; Int -&gt; DataCon
</span><a href="GHC.Builtin.Types.html#tupleDataCon"><span class="hs-identifier hs-var">tupleDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><a href="GHC.Types.Basic.html#Unboxed"><span class="hs-identifier hs-var">Unboxed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953495"><span class="hs-identifier hs-var">scrt_bndrs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-491"></span><span>                 </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953495"><span class="hs-identifier hs-var">scrt_bndrs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-492"></span><span>                 </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953491"><span class="hs-identifier hs-var">inner_case</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-493"></span><span>
</span><span id="line-494"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseAlts"><span class="hs-identifier hs-var">unariseAlts</span></a></span><span> </span><span id="local-6989586621680953490"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953490"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="annot"><span class="annottext">AltType
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680953489"><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953489"><span class="hs-identifier hs-var">alts</span></a></span></span><span>
</span><span id="line-495"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((AltCon, [Id], GenStgExpr 'Vanilla)
 -&gt; UniqSM (AltCon, [Id], GenStgExpr 'Vanilla))
-&gt; [(AltCon, [Id], GenStgExpr 'Vanilla)]
-&gt; UniqSM [(AltCon, [Id], GenStgExpr 'Vanilla)]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621680953488"><span class="annot"><span class="annottext">(AltCon, [Id], GenStgExpr 'Vanilla)
</span><a href="#local-6989586621680953488"><span class="hs-identifier hs-var">alt</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; GenStgAlt 'Vanilla -&gt; UniqSM (GenStgAlt 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseAlt"><span class="hs-identifier hs-var">unariseAlt</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953490"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">(AltCon, [Id], GenStgExpr 'Vanilla)
GenStgAlt 'Vanilla
</span><a href="#local-6989586621680953488"><span class="hs-identifier hs-var">alt</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953489"><span class="hs-identifier hs-var">alts</span></a></span><span>
</span><span id="line-496"></span><span>
</span><span id="line-497"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseAlt"><span class="hs-identifier hs-type">unariseAlt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgAlt"><span class="hs-identifier hs-type">StgAlt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgAlt"><span class="hs-identifier hs-type">StgAlt</span></a></span><span>
</span><span id="line-498"></span><span id="unariseAlt"><span class="annot"><span class="annottext">unariseAlt :: UnariseEnv -&gt; GenStgAlt 'Vanilla -&gt; UniqSM (GenStgAlt 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseAlt"><span class="hs-identifier hs-var hs-var">unariseAlt</span></a></span></span><span> </span><span id="local-6989586621680953486"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953486"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680953485"><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621680953485"><span class="hs-identifier hs-var">con</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953484"><span class="annot"><span class="annottext">[BinderP 'Vanilla]
</span><a href="#local-6989586621680953484"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953483"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953483"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-499"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680953482"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953482"><span class="hs-identifier hs-var">rho'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953481"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953481"><span class="hs-identifier hs-var">xs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; [Id] -&gt; UniqSM (UnariseEnv, [Id])
</span><a href="GHC.Stg.Unarise.html#unariseConArgBinders"><span class="hs-identifier hs-var">unariseConArgBinders</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953486"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[BinderP 'Vanilla]
</span><a href="#local-6989586621680953484"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-500"></span><span>       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621680953485"><span class="hs-identifier hs-var">con</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953481"><span class="hs-identifier hs-var">xs'</span></a></span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(GenStgExpr 'Vanilla -&gt; (AltCon, [Id], GenStgExpr 'Vanilla))
-&gt; UniqSM (GenStgExpr 'Vanilla)
-&gt; UniqSM (AltCon, [Id], GenStgExpr 'Vanilla)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953482"><span class="hs-identifier hs-var">rho'</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953483"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-501"></span><span>
</span><span id="line-502"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-503"></span><span>
</span><span id="line-504"></span><span class="hs-comment">-- | Make alternatives that match on the tag of a sum</span><span>
</span><span id="line-505"></span><span class="hs-comment">-- (i.e. generate LitAlts for the tag)</span><span>
</span><span id="line-506"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseSumAlts"><span class="hs-identifier hs-type">unariseSumAlts</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span>
</span><span id="line-507"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgArg"><span class="hs-identifier hs-type">StgArg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- sum components _excluding_ the tag bit.</span><span>
</span><span id="line-508"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgAlt"><span class="hs-identifier hs-type">StgAlt</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- original alternative with sum LHS</span><span>
</span><span id="line-509"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgAlt"><span class="hs-identifier hs-type">StgAlt</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-510"></span><span id="unariseSumAlts"><span class="annot"><span class="annottext">unariseSumAlts :: UnariseEnv
-&gt; [OutStgArg]
-&gt; [GenStgAlt 'Vanilla]
-&gt; UniqSM [GenStgAlt 'Vanilla]
</span><a href="GHC.Stg.Unarise.html#unariseSumAlts"><span class="hs-identifier hs-var hs-var">unariseSumAlts</span></a></span></span><span> </span><span id="local-6989586621680953479"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953479"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621680953478"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953478"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621680953477"><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953477"><span class="hs-identifier hs-var">alts</span></a></span></span><span>
</span><span id="line-511"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621680953476"><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
</span><a href="#local-6989586621680953476"><span class="hs-identifier hs-var">alts'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">((AltCon, [Id], GenStgExpr 'Vanilla)
 -&gt; UniqSM (AltCon, [Id], GenStgExpr 'Vanilla))
-&gt; [(AltCon, [Id], GenStgExpr 'Vanilla)]
-&gt; UniqSM [(AltCon, [Id], GenStgExpr 'Vanilla)]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnariseEnv
-&gt; [OutStgArg] -&gt; GenStgAlt 'Vanilla -&gt; UniqSM (GenStgAlt 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseSumAlt"><span class="hs-identifier hs-var">unariseSumAlt</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953479"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953478"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953477"><span class="hs-identifier hs-var">alts</span></a></span><span>
</span><span id="line-512"></span><span>       </span><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
-&gt; UniqSM [(AltCon, [Id], GenStgExpr 'Vanilla)]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla] -&gt; [GenStgAlt 'Vanilla]
</span><a href="GHC.Stg.Unarise.html#mkDefaultLitAlt"><span class="hs-identifier hs-var">mkDefaultLitAlt</span></a></span><span> </span><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953476"><span class="hs-identifier hs-var">alts'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-513"></span><span>
</span><span id="line-514"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseSumAlt"><span class="hs-identifier hs-type">unariseSumAlt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span>
</span><span id="line-515"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgArg"><span class="hs-identifier hs-type">StgArg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- sum components _excluding_ the tag bit.</span><span>
</span><span id="line-516"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgAlt"><span class="hs-identifier hs-type">StgAlt</span></a></span><span>   </span><span class="hs-comment">-- original alternative with sum LHS</span><span>
</span><span id="line-517"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgAlt"><span class="hs-identifier hs-type">StgAlt</span></a></span><span>
</span><span id="line-518"></span><span id="unariseSumAlt"><span class="annot"><span class="annottext">unariseSumAlt :: UnariseEnv
-&gt; [OutStgArg] -&gt; GenStgAlt 'Vanilla -&gt; UniqSM (GenStgAlt 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseSumAlt"><span class="hs-identifier hs-var hs-var">unariseSumAlt</span></a></span></span><span> </span><span id="local-6989586621680953473"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953473"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">AltCon
</span><a href="GHC.Core.html#DEFAULT"><span class="hs-identifier hs-var">DEFAULT</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[BinderP 'Vanilla]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953472"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953472"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-519"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">AltCon
</span><a href="GHC.Core.html#DEFAULT"><span class="hs-identifier hs-var">DEFAULT</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(GenStgExpr 'Vanilla -&gt; (AltCon, [Id], GenStgExpr 'Vanilla))
-&gt; UniqSM (GenStgExpr 'Vanilla)
-&gt; UniqSM (AltCon, [Id], GenStgExpr 'Vanilla)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953473"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953472"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-520"></span><span>
</span><span id="line-521"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseSumAlt"><span class="hs-identifier hs-var">unariseSumAlt</span></a></span><span> </span><span id="local-6989586621680953471"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953471"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span id="local-6989586621680953470"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953470"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-type">DataAlt</span></a></span><span> </span><span id="local-6989586621680953469"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680953469"><span class="hs-identifier hs-var">sumCon</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953468"><span class="annot"><span class="annottext">[BinderP 'Vanilla]
</span><a href="#local-6989586621680953468"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953467"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953467"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-522"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680953466"><span class="annot"><span class="annottext">rho' :: UnariseEnv
</span><a href="#local-6989586621680953466"><span class="hs-identifier hs-var hs-var">rho'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; [OutStgArg] -&gt; UnariseEnv -&gt; UnariseEnv
</span><a href="GHC.Stg.Unarise.html#mapSumIdBinders"><span class="hs-identifier hs-var">mapSumIdBinders</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[BinderP 'Vanilla]
</span><a href="#local-6989586621680953468"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953470"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953471"><span class="hs-identifier hs-var">rho</span></a></span><span>
</span><span id="line-523"></span><span>       </span><span id="local-6989586621680953465"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953465"><span class="hs-identifier hs-var">e'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; GenStgExpr 'Vanilla -&gt; UniqSM (GenStgExpr 'Vanilla)
</span><a href="GHC.Stg.Unarise.html#unariseExpr"><span class="hs-identifier hs-var">unariseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953466"><span class="hs-identifier hs-var">rho'</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953467"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-524"></span><span>       </span><span class="annot"><span class="annottext">(AltCon, [Id], GenStgExpr 'Vanilla)
-&gt; UniqSM (AltCon, [Id], GenStgExpr 'Vanilla)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">Literal -&gt; AltCon
</span><a href="GHC.Core.html#LitAlt"><span class="hs-identifier hs-var">LitAlt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LitNumType -&gt; Integer -&gt; Literal
</span><a href="GHC.Types.Literal.html#LitNumber"><span class="hs-identifier hs-var">LitNumber</span></a></span><span> </span><span class="annot"><span class="annottext">LitNumType
</span><a href="GHC.Types.Literal.html#LitNumInt"><span class="hs-identifier hs-var">LitNumInt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; Int
</span><a href="GHC.Core.DataCon.html#dataConTag"><span class="hs-identifier hs-var">dataConTag</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680953469"><span class="hs-identifier hs-var">sumCon</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953465"><span class="hs-identifier hs-var">e'</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-525"></span><span>
</span><span id="line-526"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseSumAlt"><span class="hs-identifier hs-var">unariseSumAlt</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680953460"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953460"><span class="hs-identifier hs-var">scrt</span></a></span></span><span> </span><span id="local-6989586621680953459"><span class="annot"><span class="annottext">GenStgAlt 'Vanilla
</span><a href="#local-6989586621680953459"><span class="hs-identifier hs-var">alt</span></a></span></span><span>
</span><span id="line-527"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; UniqSM (AltCon, [Id], GenStgExpr 'Vanilla)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;unariseSumAlt&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OutStgArg] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953460"><span class="hs-identifier hs-var">scrt</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">(AltCon, [Id], GenStgExpr 'Vanilla) -&gt; SDoc
forall a b (pass :: StgPass).
(Outputable a, Outputable b, OutputablePass pass) =&gt;
(a, b, GenStgExpr pass) -&gt; SDoc
</span><a href="GHC.Stg.Unarise.html#pprPanicAlt"><span class="hs-identifier hs-var">pprPanicAlt</span></a></span><span> </span><span class="annot"><span class="annottext">(AltCon, [Id], GenStgExpr 'Vanilla)
GenStgAlt 'Vanilla
</span><a href="#local-6989586621680953459"><span class="hs-identifier hs-var">alt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-528"></span><span>
</span><span id="line-529"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-530"></span><span>
</span><span id="line-531"></span><span class="annot"><a href="GHC.Stg.Unarise.html#mapTupleIdBinders"><span class="hs-identifier hs-type">mapTupleIdBinders</span></a></span><span>
</span><span id="line-532"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#InId"><span class="hs-identifier hs-type">InId</span></a></span><span class="hs-special">]</span><span>       </span><span class="hs-comment">-- Un-processed binders of a tuple alternative.</span><span>
</span><span id="line-533"></span><span>                  </span><span class="hs-comment">-- Can have void binders.</span><span>
</span><span id="line-534"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#OutStgArg"><span class="hs-identifier hs-type">OutStgArg</span></a></span><span class="hs-special">]</span><span>  </span><span class="hs-comment">-- Arguments that form the tuple (after unarisation).</span><span>
</span><span id="line-535"></span><span>                  </span><span class="hs-comment">-- Can't have void args.</span><span>
</span><span id="line-536"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span>
</span><span id="line-537"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span>
</span><span id="line-538"></span><span id="mapTupleIdBinders"><span class="annot"><span class="annottext">mapTupleIdBinders :: [Id] -&gt; [OutStgArg] -&gt; UnariseEnv -&gt; UnariseEnv
</span><a href="GHC.Stg.Unarise.html#mapTupleIdBinders"><span class="hs-identifier hs-var hs-var">mapTupleIdBinders</span></a></span></span><span> </span><span id="local-6989586621680953457"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953457"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621680953456"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953456"><span class="hs-identifier hs-var">args0</span></a></span></span><span> </span><span id="local-6989586621680953455"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953455"><span class="hs-identifier hs-var">rho0</span></a></span></span><span>
</span><span id="line-539"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">not</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">any</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">isVoidTy</span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-identifier">stgArgType</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">args0</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-540"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-541"></span><span>      </span><span class="annot"><a href="#local-6989586621680953452"><span class="hs-identifier hs-type">ids_unarised</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-542"></span><span>      </span><span id="local-6989586621680953452"><span class="annot"><span class="annottext">ids_unarised :: [(Id, [PrimRep])]
</span><a href="#local-6989586621680953452"><span class="hs-identifier hs-var hs-var">ids_unarised</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; (Id, [PrimRep])) -&gt; [Id] -&gt; [(Id, [PrimRep])]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621680953451"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953451"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953451"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; [PrimRep]
Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var">typePrimRep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953451"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953457"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-543"></span><span>
</span><span id="line-544"></span><span>      </span><span class="annot"><a href="#local-6989586621680953448"><span class="hs-identifier hs-type">map_ids</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCon.html#PrimRep"><span class="hs-identifier hs-type">PrimRep</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgArg"><span class="hs-identifier hs-type">StgArg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span>
</span><span id="line-545"></span><span>      </span><span id="local-6989586621680953448"><span class="annot"><span class="annottext">map_ids :: UnariseEnv -&gt; [(Id, [PrimRep])] -&gt; [OutStgArg] -&gt; UnariseEnv
</span><a href="#local-6989586621680953448"><span class="hs-identifier hs-var hs-var">map_ids</span></a></span></span><span> </span><span id="local-6989586621680953447"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953447"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953447"><span class="hs-identifier hs-var">rho</span></a></span><span>
</span><span id="line-546"></span><span>      </span><span class="annot"><a href="#local-6989586621680953448"><span class="hs-identifier hs-var">map_ids</span></a></span><span> </span><span id="local-6989586621680953446"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953446"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621680953445"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953445"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953444"><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621680953444"><span class="hs-identifier hs-var">x_reps</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680953443"><span class="annot"><span class="annottext">[(Id, [PrimRep])]
</span><a href="#local-6989586621680953443"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680953442"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953442"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-547"></span><span>        </span><span class="hs-keyword">let</span><span>
</span><span id="line-548"></span><span>          </span><span id="local-6989586621680953440"><span class="annot"><span class="annottext">x_arity :: Int
</span><a href="#local-6989586621680953440"><span class="hs-identifier hs-var hs-var">x_arity</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[PrimRep] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621680953444"><span class="hs-identifier hs-var">x_reps</span></a></span><span>
</span><span id="line-549"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621680953439"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953439"><span class="hs-identifier hs-var">x_args</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953438"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953438"><span class="hs-identifier hs-var">args'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-550"></span><span>            </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">args</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">lengthAtLeast</span><span class="hs-special">`</span><span> </span><span class="hs-identifier">x_arity</span><span class="hs-special">)</span><span>
</span><span id="line-551"></span><span>            </span><span class="annot"><span class="annottext">Int -&gt; [OutStgArg] -&gt; ([OutStgArg], [OutStgArg])
forall a. Int -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/GHC.List.html#splitAt"><span class="hs-identifier hs-var">splitAt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680953440"><span class="hs-identifier hs-var">x_arity</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953442"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-552"></span><span>
</span><span id="line-553"></span><span>          </span><span id="local-6989586621680953432"><span class="annot"><span class="annottext">rho' :: UnariseEnv
</span><a href="#local-6989586621680953432"><span class="hs-identifier hs-var hs-var">rho'</span></a></span></span><span>
</span><span id="line-554"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680953440"><span class="hs-identifier hs-var">x_arity</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-555"></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">x_args</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">lengthIs</span><span class="hs-special">`</span><span> </span><span class="hs-number">1</span><span class="hs-special">)</span><span>
</span><span id="line-556"></span><span>              </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; UnariseVal -&gt; UnariseEnv
</span><a href="GHC.Stg.Unarise.html#extendRho"><span class="hs-identifier hs-var">extendRho</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953446"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953445"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OutStgArg -&gt; UnariseVal
</span><a href="GHC.Stg.Unarise.html#UnaryVal"><span class="hs-identifier hs-var">UnaryVal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OutStgArg] -&gt; OutStgArg
forall a. [a] -&gt; a
</span><a href="../../base/src/GHC.List.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953439"><span class="hs-identifier hs-var">x_args</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-557"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-558"></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; UnariseVal -&gt; UnariseEnv
</span><a href="GHC.Stg.Unarise.html#extendRho"><span class="hs-identifier hs-var">extendRho</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953446"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953445"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OutStgArg] -&gt; UnariseVal
</span><a href="GHC.Stg.Unarise.html#MultiVal"><span class="hs-identifier hs-var">MultiVal</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953439"><span class="hs-identifier hs-var">x_args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-559"></span><span>        </span><span class="hs-keyword">in</span><span>
</span><span id="line-560"></span><span>          </span><span class="annot"><span class="annottext">UnariseEnv -&gt; [(Id, [PrimRep])] -&gt; [OutStgArg] -&gt; UnariseEnv
</span><a href="#local-6989586621680953448"><span class="hs-identifier hs-var">map_ids</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953432"><span class="hs-identifier hs-var">rho'</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, [PrimRep])]
</span><a href="#local-6989586621680953443"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953438"><span class="hs-identifier hs-var">args'</span></a></span><span>
</span><span id="line-561"></span><span>    </span><span class="hs-keyword">in</span><span>
</span><span id="line-562"></span><span>      </span><span class="annot"><span class="annottext">UnariseEnv -&gt; [(Id, [PrimRep])] -&gt; [OutStgArg] -&gt; UnariseEnv
</span><a href="#local-6989586621680953448"><span class="hs-identifier hs-var">map_ids</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953455"><span class="hs-identifier hs-var">rho0</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, [PrimRep])]
</span><a href="#local-6989586621680953452"><span class="hs-identifier hs-var">ids_unarised</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953456"><span class="hs-identifier hs-var">args0</span></a></span><span>
</span><span id="line-563"></span><span>
</span><span id="line-564"></span><span class="annot"><a href="GHC.Stg.Unarise.html#mapSumIdBinders"><span class="hs-identifier hs-type">mapSumIdBinders</span></a></span><span>
</span><span id="line-565"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#InId"><span class="hs-identifier hs-type">InId</span></a></span><span class="hs-special">]</span><span>      </span><span class="hs-comment">-- Binder of a sum alternative (remember that sum patterns</span><span>
</span><span id="line-566"></span><span>                 </span><span class="hs-comment">-- only have one binder, so this list should be a singleton)</span><span>
</span><span id="line-567"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#OutStgArg"><span class="hs-identifier hs-type">OutStgArg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- Arguments that form the sum (NOT including the tag).</span><span>
</span><span id="line-568"></span><span>                 </span><span class="hs-comment">-- Can't have void args.</span><span>
</span><span id="line-569"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span>
</span><span id="line-570"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span>
</span><span id="line-571"></span><span>
</span><span id="line-572"></span><span id="mapSumIdBinders"><span class="annot"><span class="annottext">mapSumIdBinders :: [Id] -&gt; [OutStgArg] -&gt; UnariseEnv -&gt; UnariseEnv
</span><a href="GHC.Stg.Unarise.html#mapSumIdBinders"><span class="hs-identifier hs-var hs-var">mapSumIdBinders</span></a></span></span><span> </span><span class="hs-special">[</span><span id="local-6989586621680953430"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953430"><span class="hs-identifier hs-var">id</span></a></span></span><span class="hs-special">]</span><span> </span><span id="local-6989586621680953429"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953429"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621680953428"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953428"><span class="hs-identifier hs-var">rho0</span></a></span></span><span>
</span><span id="line-573"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">not</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">any</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">isVoidTy</span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-identifier">stgArgType</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">args</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-574"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-575"></span><span>      </span><span id="local-6989586621680953425"><span class="annot"><span class="annottext">arg_slots :: [SlotTy]
</span><a href="#local-6989586621680953425"><span class="hs-identifier hs-var hs-var">arg_slots</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(PrimRep -&gt; SlotTy) -&gt; [PrimRep] -&gt; [SlotTy]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep -&gt; SlotTy
</span><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><span class="annottext">([PrimRep] -&gt; [SlotTy]) -&gt; [PrimRep] -&gt; [SlotTy]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(OutStgArg -&gt; [PrimRep]) -&gt; [OutStgArg] -&gt; [PrimRep]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; [PrimRep]
Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var">typePrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; [PrimRep])
-&gt; (OutStgArg -&gt; Type) -&gt; OutStgArg -&gt; [PrimRep]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">OutStgArg -&gt; Type
</span><a href="GHC.Stg.Syntax.html#stgArgType"><span class="hs-identifier hs-var">stgArgType</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953429"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-576"></span><span>      </span><span id="local-6989586621680953421"><span class="annot"><span class="annottext">id_slots :: [SlotTy]
</span><a href="#local-6989586621680953421"><span class="hs-identifier hs-var hs-var">id_slots</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(PrimRep -&gt; SlotTy) -&gt; [PrimRep] -&gt; [SlotTy]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep -&gt; SlotTy
</span><a href="GHC.Types.RepType.html#primRepSlot"><span class="hs-identifier hs-var">primRepSlot</span></a></span><span> </span><span class="annot"><span class="annottext">([PrimRep] -&gt; [SlotTy]) -&gt; [PrimRep] -&gt; [SlotTy]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; [PrimRep]
Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var">typePrimRep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953430"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-577"></span><span>      </span><span id="local-6989586621680953420"><span class="annot"><span class="annottext">layout1 :: [Int]
</span><a href="#local-6989586621680953420"><span class="hs-identifier hs-var hs-var">layout1</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SlotTy] -&gt; [SlotTy] -&gt; [Int]
</span><a href="GHC.Types.RepType.html#layoutUbxSum"><span class="hs-identifier hs-var">layoutUbxSum</span></a></span><span> </span><span class="annot"><span class="annottext">[SlotTy]
</span><a href="#local-6989586621680953425"><span class="hs-identifier hs-var">arg_slots</span></a></span><span> </span><span class="annot"><span class="annottext">[SlotTy]
</span><a href="#local-6989586621680953421"><span class="hs-identifier hs-var">id_slots</span></a></span><span>
</span><span id="line-578"></span><span>    </span><span class="hs-keyword">in</span><span>
</span><span id="line-579"></span><span>      </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Stg.Unarise.html#isMultiValBndr"><span class="hs-identifier hs-var">isMultiValBndr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953430"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-580"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; UnariseVal -&gt; UnariseEnv
</span><a href="GHC.Stg.Unarise.html#extendRho"><span class="hs-identifier hs-var">extendRho</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953428"><span class="hs-identifier hs-var">rho0</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953430"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OutStgArg] -&gt; UnariseVal
</span><a href="GHC.Stg.Unarise.html#MultiVal"><span class="hs-identifier hs-var">MultiVal</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953429"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg] -&gt; Int -&gt; OutStgArg
forall a. [a] -&gt; Int -&gt; a
</span><a href="../../base/src/GHC.List.html#%21%21"><span class="hs-operator hs-var">!!</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680953416"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621680953416"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680953416"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Int]
</span><a href="#local-6989586621680953420"><span class="hs-identifier hs-var">layout1</span></a></span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-581"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">layout1</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">lengthIs</span><span class="hs-special">`</span><span> </span><span class="hs-number">1</span><span class="hs-special">)</span><span>
</span><span id="line-582"></span><span>             </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; UnariseVal -&gt; UnariseEnv
</span><a href="GHC.Stg.Unarise.html#extendRho"><span class="hs-identifier hs-var">extendRho</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953428"><span class="hs-identifier hs-var">rho0</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953430"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OutStgArg -&gt; UnariseVal
</span><a href="GHC.Stg.Unarise.html#UnaryVal"><span class="hs-identifier hs-var">UnaryVal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953429"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg] -&gt; Int -&gt; OutStgArg
forall a. [a] -&gt; Int -&gt; a
</span><a href="../../base/src/GHC.List.html#%21%21"><span class="hs-operator hs-var">!!</span></a></span><span> </span><span class="annot"><span class="annottext">[Int] -&gt; Int
forall a. [a] -&gt; a
</span><a href="../../base/src/GHC.List.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">[Int]
</span><a href="#local-6989586621680953420"><span class="hs-identifier hs-var">layout1</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-583"></span><span>
</span><span id="line-584"></span><span class="annot"><a href="GHC.Stg.Unarise.html#mapSumIdBinders"><span class="hs-identifier hs-var">mapSumIdBinders</span></a></span><span> </span><span id="local-6989586621680953415"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953415"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621680953414"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953414"><span class="hs-identifier hs-var">sum_args</span></a></span></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-585"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; UnariseEnv
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;mapSumIdBinders&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953415"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953414"><span class="hs-identifier hs-var">sum_args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-586"></span><span>
</span><span id="line-587"></span><span class="hs-comment">-- | Build a unboxed sum term from arguments of an alternative.</span><span>
</span><span id="line-588"></span><span class="hs-comment">--</span><span>
</span><span id="line-589"></span><span class="hs-comment">-- Example, for (# x | #) :: (# (# #) | Int #) we call</span><span>
</span><span id="line-590"></span><span class="hs-comment">--</span><span>
</span><span id="line-591"></span><span class="hs-comment">--   mkUbxSum (# _ | #) [ (# #), Int ] [ voidPrimId ]</span><span>
</span><span id="line-592"></span><span class="hs-comment">--</span><span>
</span><span id="line-593"></span><span class="hs-comment">-- which returns</span><span>
</span><span id="line-594"></span><span class="hs-comment">--</span><span>
</span><span id="line-595"></span><span class="hs-comment">--   [ 1#, rubbish ]</span><span>
</span><span id="line-596"></span><span class="hs-comment">--</span><span>
</span><span id="line-597"></span><span class="annot"><a href="GHC.Stg.Unarise.html#mkUbxSum"><span class="hs-identifier hs-type">mkUbxSum</span></a></span><span>
</span><span id="line-598"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span>      </span><span class="hs-comment">-- Sum data con</span><span>
</span><span id="line-599"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span>       </span><span class="hs-comment">-- Type arguments of the sum data con</span><span>
</span><span id="line-600"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#OutStgArg"><span class="hs-identifier hs-type">OutStgArg</span></a></span><span class="hs-special">]</span><span>  </span><span class="hs-comment">-- Actual arguments of the alternative.</span><span>
</span><span id="line-601"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#OutStgArg"><span class="hs-identifier hs-type">OutStgArg</span></a></span><span class="hs-special">]</span><span>  </span><span class="hs-comment">-- Final tuple arguments</span><span>
</span><span id="line-602"></span><span id="mkUbxSum"><span class="annot"><span class="annottext">mkUbxSum :: DataCon -&gt; [Type] -&gt; [OutStgArg] -&gt; [OutStgArg]
</span><a href="GHC.Stg.Unarise.html#mkUbxSum"><span class="hs-identifier hs-var hs-var">mkUbxSum</span></a></span></span><span> </span><span id="local-6989586621680953413"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680953413"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span id="local-6989586621680953412"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680953412"><span class="hs-identifier hs-var">ty_args</span></a></span></span><span> </span><span id="local-6989586621680953411"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953411"><span class="hs-identifier hs-var">args0</span></a></span></span><span>
</span><span id="line-603"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-604"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SlotTy
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680953409"><span class="annot"><span class="annottext">[SlotTy]
</span><a href="#local-6989586621680953409"><span class="hs-identifier hs-var">sum_slots</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[[PrimRep]] -&gt; [SlotTy]
</span><a href="GHC.Types.RepType.html#ubxSumRepType"><span class="hs-identifier hs-var">ubxSumRepType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Type -&gt; [PrimRep]) -&gt; [Type] -&gt; [[PrimRep]]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; [PrimRep]
Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var">typePrimRep</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680953412"><span class="hs-identifier hs-var">ty_args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-605"></span><span>        </span><span class="hs-comment">-- drop tag slot</span><span>
</span><span id="line-606"></span><span>
</span><span id="line-607"></span><span>      </span><span id="local-6989586621680953407"><span class="annot"><span class="annottext">tag :: Int
</span><a href="#local-6989586621680953407"><span class="hs-identifier hs-var hs-var">tag</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Int
</span><a href="GHC.Core.DataCon.html#dataConTag"><span class="hs-identifier hs-var">dataConTag</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680953413"><span class="hs-identifier hs-var">dc</span></a></span><span>
</span><span id="line-608"></span><span>
</span><span id="line-609"></span><span>      </span><span id="local-6989586621680953406"><span class="annot"><span class="annottext">layout' :: [Int]
</span><a href="#local-6989586621680953406"><span class="hs-identifier hs-var hs-var">layout'</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SlotTy] -&gt; [SlotTy] -&gt; [Int]
</span><a href="GHC.Types.RepType.html#layoutUbxSum"><span class="hs-identifier hs-var">layoutUbxSum</span></a></span><span> </span><span class="annot"><span class="annottext">[SlotTy]
</span><a href="#local-6989586621680953409"><span class="hs-identifier hs-var">sum_slots</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(OutStgArg -&gt; Maybe SlotTy) -&gt; [OutStgArg] -&gt; [SlotTy]
forall a b. (a -&gt; Maybe b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/Data.Maybe.html#mapMaybe"><span class="hs-identifier hs-var">mapMaybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Maybe SlotTy
</span><a href="GHC.Types.RepType.html#typeSlotTy"><span class="hs-identifier hs-var">typeSlotTy</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Maybe SlotTy)
-&gt; (OutStgArg -&gt; Type) -&gt; OutStgArg -&gt; Maybe SlotTy
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">OutStgArg -&gt; Type
</span><a href="GHC.Stg.Syntax.html#stgArgType"><span class="hs-identifier hs-var">stgArgType</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953411"><span class="hs-identifier hs-var">args0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-610"></span><span>      </span><span id="local-6989586621680953402"><span class="annot"><span class="annottext">tag_arg :: OutStgArg
</span><a href="#local-6989586621680953402"><span class="hs-identifier hs-var hs-var">tag_arg</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Literal -&gt; OutStgArg
</span><a href="GHC.Stg.Syntax.html#StgLitArg"><span class="hs-identifier hs-var">StgLitArg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LitNumType -&gt; Integer -&gt; Literal
</span><a href="GHC.Types.Literal.html#LitNumber"><span class="hs-identifier hs-var">LitNumber</span></a></span><span> </span><span class="annot"><span class="annottext">LitNumType
</span><a href="GHC.Types.Literal.html#LitNumInt"><span class="hs-identifier hs-var">LitNumInt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680953407"><span class="hs-identifier hs-var">tag</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-611"></span><span>      </span><span id="local-6989586621680953401"><span class="annot"><span class="annottext">arg_idxs :: IntMap OutStgArg
</span><a href="#local-6989586621680953401"><span class="hs-identifier hs-var hs-var">arg_idxs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Int, OutStgArg)] -&gt; IntMap OutStgArg
forall a. [(Int, a)] -&gt; IntMap a
</span><a href="../../containers/src/Data.IntMap.Internal.html#fromList"><span class="hs-identifier hs-var">IM.fromList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; [Int] -&gt; [OutStgArg] -&gt; [(Int, OutStgArg)]
forall a b. String -&gt; [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="GHC.Utils.Misc.html#zipEqual"><span class="hs-identifier hs-var">zipEqual</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;mkUbxSum&quot;</span></span><span> </span><span class="annot"><span class="annottext">[Int]
</span><a href="#local-6989586621680953406"><span class="hs-identifier hs-var">layout'</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953411"><span class="hs-identifier hs-var">args0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-612"></span><span>
</span><span id="line-613"></span><span>      </span><span class="annot"><a href="#local-6989586621680953398"><span class="hs-identifier hs-type">mkTupArgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.RepType.html#SlotTy"><span class="hs-identifier hs-type">SlotTy</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.IntMap.Internal.html#IntMap"><span class="hs-identifier hs-type">IM.IntMap</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgArg"><span class="hs-identifier hs-type">StgArg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgArg"><span class="hs-identifier hs-type">StgArg</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-614"></span><span>      </span><span id="local-6989586621680953398"><span class="annot"><span class="annottext">mkTupArgs :: Int -&gt; [SlotTy] -&gt; IntMap OutStgArg -&gt; [OutStgArg]
</span><a href="#local-6989586621680953398"><span class="hs-identifier hs-var hs-var">mkTupArgs</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">IntMap OutStgArg
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-615"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-616"></span><span>      </span><span class="annot"><a href="#local-6989586621680953398"><span class="hs-identifier hs-var">mkTupArgs</span></a></span><span> </span><span id="local-6989586621680953397"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680953397"><span class="hs-identifier hs-var">arg_idx</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680953396"><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680953396"><span class="hs-identifier hs-var">slot</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680953395"><span class="annot"><span class="annottext">[SlotTy]
</span><a href="#local-6989586621680953395"><span class="hs-identifier hs-var">slots_left</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680953394"><span class="annot"><span class="annottext">IntMap OutStgArg
</span><a href="#local-6989586621680953394"><span class="hs-identifier hs-var">arg_map</span></a></span></span><span>
</span><span id="line-617"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680953393"><span class="annot"><span class="annottext">OutStgArg
</span><a href="#local-6989586621680953393"><span class="hs-identifier hs-var">stg_arg</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; IntMap OutStgArg -&gt; Maybe OutStgArg
forall a. Int -&gt; IntMap a -&gt; Maybe a
</span><a href="../../containers/src/Data.IntMap.Internal.html#lookup"><span class="hs-identifier hs-var">IM.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680953397"><span class="hs-identifier hs-var">arg_idx</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap OutStgArg
</span><a href="#local-6989586621680953394"><span class="hs-identifier hs-var">arg_map</span></a></span><span>
</span><span id="line-618"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OutStgArg
</span><a href="#local-6989586621680953393"><span class="hs-identifier hs-var">stg_arg</span></a></span><span> </span><span class="annot"><span class="annottext">OutStgArg -&gt; [OutStgArg] -&gt; [OutStgArg]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [SlotTy] -&gt; IntMap OutStgArg -&gt; [OutStgArg]
</span><a href="#local-6989586621680953398"><span class="hs-identifier hs-var">mkTupArgs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680953397"><span class="hs-identifier hs-var">arg_idx</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[SlotTy]
</span><a href="#local-6989586621680953395"><span class="hs-identifier hs-var">slots_left</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap OutStgArg
</span><a href="#local-6989586621680953394"><span class="hs-identifier hs-var">arg_map</span></a></span><span>
</span><span id="line-619"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-620"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SlotTy -&gt; OutStgArg
</span><a href="GHC.Stg.Unarise.html#ubxSumRubbishArg"><span class="hs-identifier hs-var">ubxSumRubbishArg</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="#local-6989586621680953396"><span class="hs-identifier hs-var">slot</span></a></span><span> </span><span class="annot"><span class="annottext">OutStgArg -&gt; [OutStgArg] -&gt; [OutStgArg]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [SlotTy] -&gt; IntMap OutStgArg -&gt; [OutStgArg]
</span><a href="#local-6989586621680953398"><span class="hs-identifier hs-var">mkTupArgs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680953397"><span class="hs-identifier hs-var">arg_idx</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[SlotTy]
</span><a href="#local-6989586621680953395"><span class="hs-identifier hs-var">slots_left</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap OutStgArg
</span><a href="#local-6989586621680953394"><span class="hs-identifier hs-var">arg_map</span></a></span><span>
</span><span id="line-621"></span><span>    </span><span class="hs-keyword">in</span><span>
</span><span id="line-622"></span><span>      </span><span class="annot"><span class="annottext">OutStgArg
</span><a href="#local-6989586621680953402"><span class="hs-identifier hs-var">tag_arg</span></a></span><span> </span><span class="annot"><span class="annottext">OutStgArg -&gt; [OutStgArg] -&gt; [OutStgArg]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [SlotTy] -&gt; IntMap OutStgArg -&gt; [OutStgArg]
</span><a href="#local-6989586621680953398"><span class="hs-identifier hs-var">mkTupArgs</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">[SlotTy]
</span><a href="#local-6989586621680953409"><span class="hs-identifier hs-var">sum_slots</span></a></span><span> </span><span class="annot"><span class="annottext">IntMap OutStgArg
</span><a href="#local-6989586621680953401"><span class="hs-identifier hs-var">arg_idxs</span></a></span><span>
</span><span id="line-623"></span><span>
</span><span id="line-624"></span><span>
</span><span id="line-625"></span><span class="hs-comment">-- | Return a rubbish value for the given slot type.</span><span>
</span><span id="line-626"></span><span class="hs-comment">--</span><span>
</span><span id="line-627"></span><span class="hs-comment">-- We use the following rubbish values:</span><span>
</span><span id="line-628"></span><span class="hs-comment">--    * Literals: 0 or 0.0</span><span>
</span><span id="line-629"></span><span class="hs-comment">--    * Pointers: `ghc-prim:GHC.Prim.Panic.absentSumFieldError`</span><span>
</span><span id="line-630"></span><span class="hs-comment">--</span><span>
</span><span id="line-631"></span><span class="hs-comment">-- See Note [aBSENT_SUM_FIELD_ERROR_ID] in &quot;GHC.Core.Make&quot;</span><span>
</span><span id="line-632"></span><span class="hs-comment">--</span><span>
</span><span id="line-633"></span><span class="annot"><a href="GHC.Stg.Unarise.html#ubxSumRubbishArg"><span class="hs-identifier hs-type">ubxSumRubbishArg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#SlotTy"><span class="hs-identifier hs-type">SlotTy</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgArg"><span class="hs-identifier hs-type">StgArg</span></a></span><span>
</span><span id="line-634"></span><span id="ubxSumRubbishArg"><span class="annot"><span class="annottext">ubxSumRubbishArg :: SlotTy -&gt; OutStgArg
</span><a href="GHC.Stg.Unarise.html#ubxSumRubbishArg"><span class="hs-identifier hs-var hs-var">ubxSumRubbishArg</span></a></span></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#PtrLiftedSlot"><span class="hs-identifier hs-var">PtrLiftedSlot</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; OutStgArg
</span><a href="GHC.Stg.Syntax.html#StgVarArg"><span class="hs-identifier hs-var">StgVarArg</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#aBSENT_SUM_FIELD_ERROR_ID"><span class="hs-identifier hs-var">aBSENT_SUM_FIELD_ERROR_ID</span></a></span><span>
</span><span id="line-635"></span><span class="annot"><a href="GHC.Stg.Unarise.html#ubxSumRubbishArg"><span class="hs-identifier hs-var">ubxSumRubbishArg</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#PtrUnliftedSlot"><span class="hs-identifier hs-var">PtrUnliftedSlot</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; OutStgArg
</span><a href="GHC.Stg.Syntax.html#StgVarArg"><span class="hs-identifier hs-var">StgVarArg</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Core.Make.html#aBSENT_SUM_FIELD_ERROR_ID"><span class="hs-identifier hs-var">aBSENT_SUM_FIELD_ERROR_ID</span></a></span><span>
</span><span id="line-636"></span><span class="annot"><a href="GHC.Stg.Unarise.html#ubxSumRubbishArg"><span class="hs-identifier hs-var">ubxSumRubbishArg</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#WordSlot"><span class="hs-identifier hs-var">WordSlot</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Literal -&gt; OutStgArg
</span><a href="GHC.Stg.Syntax.html#StgLitArg"><span class="hs-identifier hs-var">StgLitArg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LitNumType -&gt; Integer -&gt; Literal
</span><a href="GHC.Types.Literal.html#LitNumber"><span class="hs-identifier hs-var">LitNumber</span></a></span><span> </span><span class="annot"><span class="annottext">LitNumType
</span><a href="GHC.Types.Literal.html#LitNumWord"><span class="hs-identifier hs-var">LitNumWord</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span>
</span><span id="line-637"></span><span class="annot"><a href="GHC.Stg.Unarise.html#ubxSumRubbishArg"><span class="hs-identifier hs-var">ubxSumRubbishArg</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#Word64Slot"><span class="hs-identifier hs-var">Word64Slot</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Literal -&gt; OutStgArg
</span><a href="GHC.Stg.Syntax.html#StgLitArg"><span class="hs-identifier hs-var">StgLitArg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LitNumType -&gt; Integer -&gt; Literal
</span><a href="GHC.Types.Literal.html#LitNumber"><span class="hs-identifier hs-var">LitNumber</span></a></span><span> </span><span class="annot"><span class="annottext">LitNumType
</span><a href="GHC.Types.Literal.html#LitNumWord64"><span class="hs-identifier hs-var">LitNumWord64</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span>
</span><span id="line-638"></span><span class="annot"><a href="GHC.Stg.Unarise.html#ubxSumRubbishArg"><span class="hs-identifier hs-var">ubxSumRubbishArg</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#FloatSlot"><span class="hs-identifier hs-var">FloatSlot</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Literal -&gt; OutStgArg
</span><a href="GHC.Stg.Syntax.html#StgLitArg"><span class="hs-identifier hs-var">StgLitArg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Rational -&gt; Literal
</span><a href="GHC.Types.Literal.html#LitFloat"><span class="hs-identifier hs-var">LitFloat</span></a></span><span> </span><span class="annot"><span class="annottext">Rational
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span>
</span><span id="line-639"></span><span class="annot"><a href="GHC.Stg.Unarise.html#ubxSumRubbishArg"><span class="hs-identifier hs-var">ubxSumRubbishArg</span></a></span><span> </span><span class="annot"><span class="annottext">SlotTy
</span><a href="GHC.Types.RepType.html#DoubleSlot"><span class="hs-identifier hs-var">DoubleSlot</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Literal -&gt; OutStgArg
</span><a href="GHC.Stg.Syntax.html#StgLitArg"><span class="hs-identifier hs-var">StgLitArg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Rational -&gt; Literal
</span><a href="GHC.Types.Literal.html#LitDouble"><span class="hs-identifier hs-var">LitDouble</span></a></span><span> </span><span class="annot"><span class="annottext">Rational
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span>
</span><span id="line-640"></span><span>
</span><span id="line-641"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-642"></span><span>
</span><span id="line-643"></span><span class="hs-comment">{-
For arguments (StgArg) and binders (Id) we have two kind of unarisation:

  - When unarising function arg binders and arguments, we don't want to remove
    void binders and arguments. For example,

      f :: (# (# #), (# #) #) -&gt; Void# -&gt; RealWorld# -&gt; ...
      f x y z = &lt;body&gt;

    Here after unarise we should still get a function with arity 3. Similarly
    in the call site we shouldn't remove void arguments:

      f (# (# #), (# #) #) voidId rw

    When unarising &lt;body&gt;, we extend the environment with these binders:

      x :-&gt; MultiVal [], y :-&gt; MultiVal [], z :-&gt; MultiVal []

    Because their rep types are `MultiRep []` (aka. void). This means that when
    we see `x` in a function argument position, we actually replace it with a
    void argument. When we see it in a DataCon argument position, we just get
    rid of it, because DataCon applications in STG are always saturated.

  - When unarising case alternative binders we remove void binders, but we
    still update the environment the same way, because those binders may be
    used in the RHS. Example:

      case x of y {
        (# x1, x2, x3 #) -&gt; &lt;RHS&gt;
      }

    We know that y can't be void, because we don't scrutinize voids, so x will
    be unarised to some number of arguments, and those arguments will have at
    least one non-void thing. So in the rho we will have something like:

      x :-&gt; MultiVal [xu1, xu2]

    Now, after we eliminate void binders in the pattern, we get exactly the same
    number of binders, and extend rho again with these:

      x1 :-&gt; UnaryVal xu1
      x2 :-&gt; MultiVal [] -- x2 is void
      x3 :-&gt; UnaryVal xu2

    Now when we see x2 in a function argument position or in return position, we
    generate void#. In constructor argument position, we just remove it.

So in short, when we have a void id,

  - We keep it if it's a lambda argument binder or
                       in argument position of an application.

  - We remove it if it's a DataCon field binder or
                         in argument position of a DataCon application.
-}</span><span>
</span><span id="line-698"></span><span>
</span><span id="line-699"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseArgBinder"><span class="hs-identifier hs-type">unariseArgBinder</span></a></span><span>
</span><span id="line-700"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-comment">-- data con arg?</span><span>
</span><span id="line-701"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-702"></span><span id="unariseArgBinder"><span class="annot"><span class="annottext">unariseArgBinder :: Bool -&gt; UnariseEnv -&gt; Id -&gt; UniqSM (UnariseEnv, [Id])
</span><a href="GHC.Stg.Unarise.html#unariseArgBinder"><span class="hs-identifier hs-var hs-var">unariseArgBinder</span></a></span></span><span> </span><span id="local-6989586621680953378"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680953378"><span class="hs-identifier hs-var">is_con_arg</span></a></span></span><span> </span><span id="local-6989586621680953377"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953377"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span id="local-6989586621680953376"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953376"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-703"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; [PrimRep]
Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var">typePrimRep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953376"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-704"></span><span>    </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-705"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680953378"><span class="hs-identifier hs-var">is_con_arg</span></a></span><span>
</span><span id="line-706"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(UnariseEnv, [Id]) -&gt; UniqSM (UnariseEnv, [Id])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; UnariseVal -&gt; UnariseEnv
</span><a href="GHC.Stg.Unarise.html#extendRho"><span class="hs-identifier hs-var">extendRho</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953377"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953376"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OutStgArg] -&gt; UnariseVal
</span><a href="GHC.Stg.Unarise.html#MultiVal"><span class="hs-identifier hs-var">MultiVal</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-707"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-comment">-- fun arg, do not remove void binders</span><span>
</span><span id="line-708"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(UnariseEnv, [Id]) -&gt; UniqSM (UnariseEnv, [Id])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; UnariseVal -&gt; UnariseEnv
</span><a href="GHC.Stg.Unarise.html#extendRho"><span class="hs-identifier hs-var">extendRho</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953377"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953376"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OutStgArg] -&gt; UnariseVal
</span><a href="GHC.Stg.Unarise.html#MultiVal"><span class="hs-identifier hs-var">MultiVal</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Types.Id.Make.html#voidArgId"><span class="hs-identifier hs-var">voidArgId</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-709"></span><span>
</span><span id="line-710"></span><span>    </span><span class="hs-special">[</span><span id="local-6989586621680953375"><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621680953375"><span class="hs-identifier hs-var">rep</span></a></span></span><span class="hs-special">]</span><span>
</span><span id="line-711"></span><span>      </span><span class="hs-comment">-- Arg represented as single variable, but original type may still be an</span><span>
</span><span id="line-712"></span><span>      </span><span class="hs-comment">-- unboxed sum/tuple, e.g. (# Void# | Void# #).</span><span>
</span><span id="line-713"></span><span>      </span><span class="hs-comment">--</span><span>
</span><span id="line-714"></span><span>      </span><span class="hs-comment">-- While not unarising the binder in this case does not break any programs</span><span>
</span><span id="line-715"></span><span>      </span><span class="hs-comment">-- (because it unarises to a single variable), it triggers StgLint as we</span><span>
</span><span id="line-716"></span><span>      </span><span class="hs-comment">-- break the post-unarisation invariant that says unboxed tuple/sum</span><span>
</span><span id="line-717"></span><span>      </span><span class="hs-comment">-- binders should vanish. See Note [Post-unarisation invariants].</span><span>
</span><span id="line-718"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Bool
</span><a href="GHC.Core.Type.html#isUnboxedSumType"><span class="hs-identifier hs-var">isUnboxedSumType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953376"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Type -&gt; Bool
</span><a href="GHC.Core.Type.html#isUnboxedTupleType"><span class="hs-identifier hs-var">isUnboxedTupleType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953376"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-719"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621680953372"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953372"><span class="hs-identifier hs-var">x'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Type -&gt; UniqSM Id
</span><a href="GHC.Stg.Unarise.html#mkId"><span class="hs-identifier hs-var">mkId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;us&quot;</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PrimRep -&gt; Type
</span><a href="GHC.Types.RepType.html#primRepToType"><span class="hs-identifier hs-var">primRepToType</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="#local-6989586621680953375"><span class="hs-identifier hs-var">rep</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-720"></span><span>            </span><span class="annot"><span class="annottext">(UnariseEnv, [Id]) -&gt; UniqSM (UnariseEnv, [Id])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; UnariseVal -&gt; UnariseEnv
</span><a href="GHC.Stg.Unarise.html#extendRho"><span class="hs-identifier hs-var">extendRho</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953377"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953376"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OutStgArg] -&gt; UnariseVal
</span><a href="GHC.Stg.Unarise.html#MultiVal"><span class="hs-identifier hs-var">MultiVal</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id -&gt; OutStgArg
</span><a href="GHC.Stg.Syntax.html#StgVarArg"><span class="hs-identifier hs-var">StgVarArg</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953372"><span class="hs-identifier hs-var">x'</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953372"><span class="hs-identifier hs-var">x'</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-721"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-722"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(UnariseEnv, [Id]) -&gt; UniqSM (UnariseEnv, [Id])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953377"><span class="hs-identifier hs-var">rho</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953376"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-723"></span><span>
</span><span id="line-724"></span><span>    </span><span id="local-6989586621680953370"><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621680953370"><span class="hs-identifier hs-var">reps</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-725"></span><span>      </span><span id="local-6989586621680953369"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953369"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; [Type] -&gt; UniqSM [Id]
</span><a href="GHC.Stg.Unarise.html#mkIds"><span class="hs-identifier hs-var">mkIds</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;us&quot;</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(PrimRep -&gt; Type) -&gt; [PrimRep] -&gt; [Type]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep -&gt; Type
</span><a href="GHC.Types.RepType.html#primRepToType"><span class="hs-identifier hs-var">primRepToType</span></a></span><span> </span><span class="annot"><span class="annottext">[PrimRep]
</span><a href="#local-6989586621680953370"><span class="hs-identifier hs-var">reps</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-726"></span><span>      </span><span class="annot"><span class="annottext">(UnariseEnv, [Id]) -&gt; UniqSM (UnariseEnv, [Id])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; UnariseVal -&gt; UnariseEnv
</span><a href="GHC.Stg.Unarise.html#extendRho"><span class="hs-identifier hs-var">extendRho</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953377"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953376"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OutStgArg] -&gt; UnariseVal
</span><a href="GHC.Stg.Unarise.html#MultiVal"><span class="hs-identifier hs-var">MultiVal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; OutStgArg) -&gt; [Id] -&gt; [OutStgArg]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; OutStgArg
</span><a href="GHC.Stg.Syntax.html#StgVarArg"><span class="hs-identifier hs-var">StgVarArg</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953369"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953369"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-727"></span><span>
</span><span id="line-728"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-729"></span><span>
</span><span id="line-730"></span><span class="hs-comment">-- | MultiVal a function argument. Never returns an empty list.</span><span>
</span><span id="line-731"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseFunArg"><span class="hs-identifier hs-type">unariseFunArg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgArg"><span class="hs-identifier hs-type">StgArg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgArg"><span class="hs-identifier hs-type">StgArg</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-732"></span><span id="unariseFunArg"><span class="annot"><span class="annottext">unariseFunArg :: UnariseEnv -&gt; OutStgArg -&gt; [OutStgArg]
</span><a href="GHC.Stg.Unarise.html#unariseFunArg"><span class="hs-identifier hs-var hs-var">unariseFunArg</span></a></span></span><span> </span><span id="local-6989586621680953366"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953366"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgVarArg"><span class="hs-identifier hs-type">StgVarArg</span></a></span><span> </span><span id="local-6989586621680953365"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953365"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-733"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; Maybe UnariseVal
forall a. VarEnv a -&gt; Id -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupVarEnv"><span class="hs-identifier hs-var">lookupVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953366"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953365"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-734"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#MultiVal"><span class="hs-identifier hs-type">MultiVal</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">OutStgArg
</span><a href="GHC.Stg.Unarise.html#voidArg"><span class="hs-identifier hs-var">voidArg</span></a></span><span class="hs-special">]</span><span>   </span><span class="hs-comment">-- NB: do not remove void args</span><span>
</span><span id="line-735"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#MultiVal"><span class="hs-identifier hs-type">MultiVal</span></a></span><span> </span><span id="local-6989586621680953363"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953363"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953363"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-736"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#UnaryVal"><span class="hs-identifier hs-type">UnaryVal</span></a></span><span> </span><span id="local-6989586621680953362"><span class="annot"><span class="annottext">OutStgArg
</span><a href="#local-6989586621680953362"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">OutStgArg
</span><a href="#local-6989586621680953362"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-737"></span><span>    </span><span class="annot"><span class="annottext">Maybe UnariseVal
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id -&gt; OutStgArg
</span><a href="GHC.Stg.Syntax.html#StgVarArg"><span class="hs-identifier hs-var">StgVarArg</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953365"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-738"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseFunArg"><span class="hs-identifier hs-var">unariseFunArg</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680953361"><span class="annot"><span class="annottext">OutStgArg
</span><a href="#local-6989586621680953361"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">OutStgArg
</span><a href="#local-6989586621680953361"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-739"></span><span>
</span><span id="line-740"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseFunArgs"><span class="hs-identifier hs-type">unariseFunArgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgArg"><span class="hs-identifier hs-type">StgArg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgArg"><span class="hs-identifier hs-type">StgArg</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-741"></span><span id="unariseFunArgs"><span class="annot"><span class="annottext">unariseFunArgs :: UnariseEnv -&gt; [OutStgArg] -&gt; [OutStgArg]
</span><a href="GHC.Stg.Unarise.html#unariseFunArgs"><span class="hs-identifier hs-var hs-var">unariseFunArgs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(OutStgArg -&gt; [OutStgArg]) -&gt; [OutStgArg] -&gt; [OutStgArg]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">((OutStgArg -&gt; [OutStgArg]) -&gt; [OutStgArg] -&gt; [OutStgArg])
-&gt; (UnariseEnv -&gt; OutStgArg -&gt; [OutStgArg])
-&gt; UnariseEnv
-&gt; [OutStgArg]
-&gt; [OutStgArg]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; OutStgArg -&gt; [OutStgArg]
</span><a href="GHC.Stg.Unarise.html#unariseFunArg"><span class="hs-identifier hs-var">unariseFunArg</span></a></span><span>
</span><span id="line-742"></span><span>
</span><span id="line-743"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseFunArgBinders"><span class="hs-identifier hs-type">unariseFunArgBinders</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-744"></span><span id="unariseFunArgBinders"><span class="annot"><span class="annottext">unariseFunArgBinders :: UnariseEnv -&gt; [Id] -&gt; UniqSM (UnariseEnv, [Id])
</span><a href="GHC.Stg.Unarise.html#unariseFunArgBinders"><span class="hs-identifier hs-var hs-var">unariseFunArgBinders</span></a></span></span><span> </span><span id="local-6989586621680953360"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953360"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span id="local-6989586621680953359"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953359"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([[Id]] -&gt; [Id]) -&gt; (UnariseEnv, [[Id]]) -&gt; (UnariseEnv, [Id])
forall (p :: * -&gt; * -&gt; *) b c a.
Bifunctor p =&gt;
(b -&gt; c) -&gt; p a b -&gt; p a c
</span><a href="../../base/src/Data.Bifunctor.html#second"><span class="hs-identifier hs-var">second</span></a></span><span> </span><span class="annot"><span class="annottext">[[Id]] -&gt; [Id]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">((UnariseEnv, [[Id]]) -&gt; (UnariseEnv, [Id]))
-&gt; UniqSM (UnariseEnv, [[Id]]) -&gt; UniqSM (UnariseEnv, [Id])
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(UnariseEnv -&gt; Id -&gt; UniqSM (UnariseEnv, [Id]))
-&gt; UnariseEnv -&gt; [Id] -&gt; UniqSM (UnariseEnv, [[Id]])
forall (m :: * -&gt; *) acc x y.
Monad m =&gt;
(acc -&gt; x -&gt; m (acc, y)) -&gt; acc -&gt; [x] -&gt; m (acc, [y])
</span><a href="GHC.Utils.Monad.html#mapAccumLM"><span class="hs-identifier hs-var">mapAccumLM</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; UniqSM (UnariseEnv, [Id])
</span><a href="GHC.Stg.Unarise.html#unariseFunArgBinder"><span class="hs-identifier hs-var">unariseFunArgBinder</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953360"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953359"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-745"></span><span>
</span><span id="line-746"></span><span class="hs-comment">-- Result list of binders is never empty</span><span>
</span><span id="line-747"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseFunArgBinder"><span class="hs-identifier hs-type">unariseFunArgBinder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-748"></span><span id="unariseFunArgBinder"><span class="annot"><span class="annottext">unariseFunArgBinder :: UnariseEnv -&gt; Id -&gt; UniqSM (UnariseEnv, [Id])
</span><a href="GHC.Stg.Unarise.html#unariseFunArgBinder"><span class="hs-identifier hs-var hs-var">unariseFunArgBinder</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; UnariseEnv -&gt; Id -&gt; UniqSM (UnariseEnv, [Id])
</span><a href="GHC.Stg.Unarise.html#unariseArgBinder"><span class="hs-identifier hs-var">unariseArgBinder</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-749"></span><span>
</span><span id="line-750"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-751"></span><span>
</span><span id="line-752"></span><span class="hs-comment">-- | MultiVal a DataCon argument. Returns an empty list when argument is void.</span><span>
</span><span id="line-753"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseConArg"><span class="hs-identifier hs-type">unariseConArg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#InStgArg"><span class="hs-identifier hs-type">InStgArg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#OutStgArg"><span class="hs-identifier hs-type">OutStgArg</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-754"></span><span id="unariseConArg"><span class="annot"><span class="annottext">unariseConArg :: UnariseEnv -&gt; OutStgArg -&gt; [OutStgArg]
</span><a href="GHC.Stg.Unarise.html#unariseConArg"><span class="hs-identifier hs-var hs-var">unariseConArg</span></a></span></span><span> </span><span id="local-6989586621680953355"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953355"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgVarArg"><span class="hs-identifier hs-type">StgVarArg</span></a></span><span> </span><span id="local-6989586621680953354"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953354"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-755"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; Maybe UnariseVal
forall a. VarEnv a -&gt; Id -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupVarEnv"><span class="hs-identifier hs-var">lookupVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953355"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953354"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-756"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#UnaryVal"><span class="hs-identifier hs-type">UnaryVal</span></a></span><span> </span><span id="local-6989586621680953353"><span class="annot"><span class="annottext">OutStgArg
</span><a href="#local-6989586621680953353"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">OutStgArg
</span><a href="#local-6989586621680953353"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-757"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#MultiVal"><span class="hs-identifier hs-type">MultiVal</span></a></span><span> </span><span id="local-6989586621680953352"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953352"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953352"><span class="hs-keyword hs-var">as</span></a></span><span>      </span><span class="hs-comment">-- 'as' can be empty</span><span>
</span><span id="line-758"></span><span>    </span><span class="annot"><span class="annottext">Maybe UnariseVal
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-759"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Bool
</span><a href="GHC.Types.RepType.html#isVoidTy"><span class="hs-identifier hs-var">isVoidTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953354"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- e.g. C realWorld#</span><span>
</span><span id="line-760"></span><span>                                  </span><span class="hs-comment">-- Here realWorld# is not in the envt, but</span><span>
</span><span id="line-761"></span><span>                                  </span><span class="hs-comment">-- is a void, and so should be eliminated</span><span>
</span><span id="line-762"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id -&gt; OutStgArg
</span><a href="GHC.Stg.Syntax.html#StgVarArg"><span class="hs-identifier hs-var">StgVarArg</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953354"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-763"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseConArg"><span class="hs-identifier hs-var">unariseConArg</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680953351"><span class="annot"><span class="annottext">arg :: OutStgArg
</span><a href="#local-6989586621680953351"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgLitArg"><span class="hs-identifier hs-type">StgLitArg</span></a></span><span> </span><span id="local-6989586621680953350"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680953350"><span class="hs-identifier hs-var">lit</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-764"></span><span>    </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">not</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">isVoidTy</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">literalType</span><span> </span><span class="hs-identifier">lit</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- We have no void literals</span><span>
</span><span id="line-765"></span><span>    </span><span class="hs-special">[</span><span class="annot"><span class="annottext">OutStgArg
</span><a href="#local-6989586621680953351"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-766"></span><span>
</span><span id="line-767"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseConArgs"><span class="hs-identifier hs-type">unariseConArgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#InStgArg"><span class="hs-identifier hs-type">InStgArg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#OutStgArg"><span class="hs-identifier hs-type">OutStgArg</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-768"></span><span id="unariseConArgs"><span class="annot"><span class="annottext">unariseConArgs :: UnariseEnv -&gt; [OutStgArg] -&gt; [OutStgArg]
</span><a href="GHC.Stg.Unarise.html#unariseConArgs"><span class="hs-identifier hs-var hs-var">unariseConArgs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(OutStgArg -&gt; [OutStgArg]) -&gt; [OutStgArg] -&gt; [OutStgArg]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">((OutStgArg -&gt; [OutStgArg]) -&gt; [OutStgArg] -&gt; [OutStgArg])
-&gt; (UnariseEnv -&gt; OutStgArg -&gt; [OutStgArg])
-&gt; UnariseEnv
-&gt; [OutStgArg]
-&gt; [OutStgArg]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; OutStgArg -&gt; [OutStgArg]
</span><a href="GHC.Stg.Unarise.html#unariseConArg"><span class="hs-identifier hs-var">unariseConArg</span></a></span><span>
</span><span id="line-769"></span><span>
</span><span id="line-770"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseConArgBinders"><span class="hs-identifier hs-type">unariseConArgBinders</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-771"></span><span id="unariseConArgBinders"><span class="annot"><span class="annottext">unariseConArgBinders :: UnariseEnv -&gt; [Id] -&gt; UniqSM (UnariseEnv, [Id])
</span><a href="GHC.Stg.Unarise.html#unariseConArgBinders"><span class="hs-identifier hs-var hs-var">unariseConArgBinders</span></a></span></span><span> </span><span id="local-6989586621680953348"><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953348"><span class="hs-identifier hs-var">rho</span></a></span></span><span> </span><span id="local-6989586621680953347"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953347"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([[Id]] -&gt; [Id]) -&gt; (UnariseEnv, [[Id]]) -&gt; (UnariseEnv, [Id])
forall (p :: * -&gt; * -&gt; *) b c a.
Bifunctor p =&gt;
(b -&gt; c) -&gt; p a b -&gt; p a c
</span><a href="../../base/src/Data.Bifunctor.html#second"><span class="hs-identifier hs-var">second</span></a></span><span> </span><span class="annot"><span class="annottext">[[Id]] -&gt; [Id]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">((UnariseEnv, [[Id]]) -&gt; (UnariseEnv, [Id]))
-&gt; UniqSM (UnariseEnv, [[Id]]) -&gt; UniqSM (UnariseEnv, [Id])
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(UnariseEnv -&gt; Id -&gt; UniqSM (UnariseEnv, [Id]))
-&gt; UnariseEnv -&gt; [Id] -&gt; UniqSM (UnariseEnv, [[Id]])
forall (m :: * -&gt; *) acc x y.
Monad m =&gt;
(acc -&gt; x -&gt; m (acc, y)) -&gt; acc -&gt; [x] -&gt; m (acc, [y])
</span><a href="GHC.Utils.Monad.html#mapAccumLM"><span class="hs-identifier hs-var">mapAccumLM</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv -&gt; Id -&gt; UniqSM (UnariseEnv, [Id])
</span><a href="GHC.Stg.Unarise.html#unariseConArgBinder"><span class="hs-identifier hs-var">unariseConArgBinder</span></a></span><span> </span><span class="annot"><span class="annottext">UnariseEnv
</span><a href="#local-6989586621680953348"><span class="hs-identifier hs-var">rho</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621680953347"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-772"></span><span>
</span><span id="line-773"></span><span class="hs-comment">-- Different from `unariseFunArgBinder`: result list of binders may be empty.</span><span>
</span><span id="line-774"></span><span class="hs-comment">-- See DataCon applications case in Note [Post-unarisation invariants].</span><span>
</span><span id="line-775"></span><span class="annot"><a href="GHC.Stg.Unarise.html#unariseConArgBinder"><span class="hs-identifier hs-type">unariseConArgBinder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Unarise.html#UnariseEnv"><span class="hs-identifier hs-type">UnariseEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-776"></span><span id="unariseConArgBinder"><span class="annot"><span class="annottext">unariseConArgBinder :: UnariseEnv -&gt; Id -&gt; UniqSM (UnariseEnv, [Id])
</span><a href="GHC.Stg.Unarise.html#unariseConArgBinder"><span class="hs-identifier hs-var hs-var">unariseConArgBinder</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; UnariseEnv -&gt; Id -&gt; UniqSM (UnariseEnv, [Id])
</span><a href="GHC.Stg.Unarise.html#unariseArgBinder"><span class="hs-identifier hs-var">unariseArgBinder</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-777"></span><span>
</span><span id="line-778"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-779"></span><span>
</span><span id="line-780"></span><span class="annot"><a href="GHC.Stg.Unarise.html#mkIds"><span class="hs-identifier hs-type">mkIds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.RepType.html#UnaryType"><span class="hs-identifier hs-type">UnaryType</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-781"></span><span id="mkIds"><span class="annot"><span class="annottext">mkIds :: FastString -&gt; [Type] -&gt; UniqSM [Id]
</span><a href="GHC.Stg.Unarise.html#mkIds"><span class="hs-identifier hs-var hs-var">mkIds</span></a></span></span><span> </span><span id="local-6989586621680953345"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680953345"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span id="local-6989586621680953344"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680953344"><span class="hs-identifier hs-var">tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; UniqSM Id) -&gt; [Type] -&gt; UniqSM [Id]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; Type -&gt; UniqSM Id
</span><a href="GHC.Stg.Unarise.html#mkId"><span class="hs-identifier hs-var">mkId</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680953345"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680953344"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-782"></span><span>
</span><span id="line-783"></span><span class="annot"><a href="GHC.Stg.Unarise.html#mkId"><span class="hs-identifier hs-type">mkId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html#UnaryType"><span class="hs-identifier hs-type">UnaryType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>
</span><span id="line-784"></span><span id="mkId"><span class="annot"><span class="annottext">mkId :: FastString -&gt; Type -&gt; UniqSM Id
</span><a href="GHC.Stg.Unarise.html#mkId"><span class="hs-identifier hs-var hs-var">mkId</span></a></span></span><span> </span><span id="local-6989586621680953343"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680953343"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621680953342"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680953342"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Type -&gt; Type -&gt; UniqSM Id
forall (m :: * -&gt; *).
MonadUnique m =&gt;
FastString -&gt; Type -&gt; Type -&gt; m Id
</span><a href="GHC.Types.Id.html#mkSysLocalM"><span class="hs-identifier hs-var">mkSysLocalM</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680953343"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680953342"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-785"></span><span>
</span><span id="line-786"></span><span class="annot"><a href="GHC.Stg.Unarise.html#isMultiValBndr"><span class="hs-identifier hs-type">isMultiValBndr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-787"></span><span id="isMultiValBndr"><span class="annot"><span class="annottext">isMultiValBndr :: Id -&gt; Bool
</span><a href="GHC.Stg.Unarise.html#isMultiValBndr"><span class="hs-identifier hs-var hs-var">isMultiValBndr</span></a></span></span><span> </span><span id="local-6989586621680953339"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953339"><span class="hs-identifier hs-var">id</span></a></span></span><span>
</span><span id="line-788"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">PrimRep
</span><span class="hs-identifier">_</span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; [PrimRep]
Type -&gt; [PrimRep]
</span><a href="GHC.Types.RepType.html#typePrimRep"><span class="hs-identifier hs-var">typePrimRep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680953339"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-789"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-790"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-791"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-792"></span><span>
</span><span id="line-793"></span><span class="annot"><a href="GHC.Stg.Unarise.html#isUnboxedSumBndr"><span class="hs-identifier hs-type">isUnboxedSumBndr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-794"></span><span id="isUnboxedSumBndr"><span class="annot"><span class="annottext">isUnboxedSumBndr :: Id -&gt; Bool
</span><a href="GHC.Stg.Unarise.html#isUnboxedSumBndr"><span class="hs-identifier hs-var hs-var">isUnboxedSumBndr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Bool
</span><a href="GHC.Core.Type.html#isUnboxedSumType"><span class="hs-identifier hs-var">isUnboxedSumType</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Bool) -&gt; (Id -&gt; Type) -&gt; Id -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span>
</span><span id="line-795"></span><span>
</span><span id="line-796"></span><span class="annot"><a href="GHC.Stg.Unarise.html#isUnboxedTupleBndr"><span class="hs-identifier hs-type">isUnboxedTupleBndr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-797"></span><span id="isUnboxedTupleBndr"><span class="annot"><span class="annottext">isUnboxedTupleBndr :: Id -&gt; Bool
</span><a href="GHC.Stg.Unarise.html#isUnboxedTupleBndr"><span class="hs-identifier hs-var hs-var">isUnboxedTupleBndr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Bool
</span><a href="GHC.Core.Type.html#isUnboxedTupleType"><span class="hs-identifier hs-var">isUnboxedTupleType</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Bool) -&gt; (Id -&gt; Type) -&gt; Id -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span>
</span><span id="line-798"></span><span>
</span><span id="line-799"></span><span class="annot"><a href="GHC.Stg.Unarise.html#mkTuple"><span class="hs-identifier hs-type">mkTuple</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgArg"><span class="hs-identifier hs-type">StgArg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgExpr"><span class="hs-identifier hs-type">StgExpr</span></a></span><span>
</span><span id="line-800"></span><span id="mkTuple"><span class="annot"><span class="annottext">mkTuple :: [OutStgArg] -&gt; GenStgExpr 'Vanilla
</span><a href="GHC.Stg.Unarise.html#mkTuple"><span class="hs-identifier hs-var hs-var">mkTuple</span></a></span></span><span> </span><span id="local-6989586621680953338"><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953338"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [OutStgArg] -&gt; [Type] -&gt; GenStgExpr 'Vanilla
forall (pass :: StgPass).
DataCon -&gt; [OutStgArg] -&gt; [Type] -&gt; GenStgExpr pass
</span><a href="GHC.Stg.Syntax.html#StgConApp"><span class="hs-identifier hs-var">StgConApp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Boxity -&gt; Int -&gt; DataCon
</span><a href="GHC.Builtin.Types.html#tupleDataCon"><span class="hs-identifier hs-var">tupleDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><a href="GHC.Types.Basic.html#Unboxed"><span class="hs-identifier hs-var">Unboxed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OutStgArg] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953338"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953338"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(OutStgArg -&gt; Type) -&gt; [OutStgArg] -&gt; [Type]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">OutStgArg -&gt; Type
</span><a href="GHC.Stg.Syntax.html#stgArgType"><span class="hs-identifier hs-var">stgArgType</span></a></span><span> </span><span class="annot"><span class="annottext">[OutStgArg]
</span><a href="#local-6989586621680953338"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-801"></span><span>
</span><span id="line-802"></span><span class="annot"><a href="GHC.Stg.Unarise.html#tagAltTy"><span class="hs-identifier hs-type">tagAltTy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#AltType"><span class="hs-identifier hs-type">AltType</span></a></span><span>
</span><span id="line-803"></span><span id="tagAltTy"><span class="annot"><span class="annottext">tagAltTy :: AltType
</span><a href="GHC.Stg.Unarise.html#tagAltTy"><span class="hs-identifier hs-var hs-var">tagAltTy</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PrimRep -&gt; AltType
</span><a href="GHC.Stg.Syntax.html#PrimAlt"><span class="hs-identifier hs-var">PrimAlt</span></a></span><span> </span><span class="annot"><span class="annottext">PrimRep
</span><a href="GHC.Core.TyCon.html#IntRep"><span class="hs-identifier hs-var">IntRep</span></a></span><span>
</span><span id="line-804"></span><span>
</span><span id="line-805"></span><span class="annot"><a href="GHC.Stg.Unarise.html#tagTy"><span class="hs-identifier hs-type">tagTy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-806"></span><span id="tagTy"><span class="annot"><span class="annottext">tagTy :: Type
</span><a href="GHC.Stg.Unarise.html#tagTy"><span class="hs-identifier hs-var hs-var">tagTy</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#intPrimTy"><span class="hs-identifier hs-var">intPrimTy</span></a></span><span>
</span><span id="line-807"></span><span>
</span><span id="line-808"></span><span class="annot"><a href="GHC.Stg.Unarise.html#voidArg"><span class="hs-identifier hs-type">voidArg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgArg"><span class="hs-identifier hs-type">StgArg</span></a></span><span>
</span><span id="line-809"></span><span id="voidArg"><span class="annot"><span class="annottext">voidArg :: OutStgArg
</span><a href="GHC.Stg.Unarise.html#voidArg"><span class="hs-identifier hs-var hs-var">voidArg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; OutStgArg
</span><a href="GHC.Stg.Syntax.html#StgVarArg"><span class="hs-identifier hs-var">StgVarArg</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Types.Id.Make.html#voidPrimId"><span class="hs-identifier hs-var">voidPrimId</span></a></span><span>
</span><span id="line-810"></span><span>
</span><span id="line-811"></span><span class="annot"><a href="GHC.Stg.Unarise.html#mkDefaultLitAlt"><span class="hs-identifier hs-type">mkDefaultLitAlt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgAlt"><span class="hs-identifier hs-type">StgAlt</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgAlt"><span class="hs-identifier hs-type">StgAlt</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-812"></span><span class="hs-comment">-- We have an exhauseive list of literal alternatives</span><span>
</span><span id="line-813"></span><span class="hs-comment">--    1# -&gt; e1</span><span>
</span><span id="line-814"></span><span class="hs-comment">--    2# -&gt; e2</span><span>
</span><span id="line-815"></span><span class="hs-comment">-- Since they are exhaustive, we can replace one with DEFAULT, to avoid</span><span>
</span><span id="line-816"></span><span class="hs-comment">-- generating a final test. Remember, the DEFAULT comes first if it exists.</span><span>
</span><span id="line-817"></span><span id="mkDefaultLitAlt"><span class="annot"><span class="annottext">mkDefaultLitAlt :: [GenStgAlt 'Vanilla] -&gt; [GenStgAlt 'Vanilla]
</span><a href="GHC.Stg.Unarise.html#mkDefaultLitAlt"><span class="hs-identifier hs-var hs-var">mkDefaultLitAlt</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; [(AltCon, [Id], GenStgExpr 'Vanilla)]
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;elimUbxSumExpr.mkDefaultAlt&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Empty alts&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-818"></span><span class="annot"><a href="GHC.Stg.Unarise.html#mkDefaultLitAlt"><span class="hs-identifier hs-var">mkDefaultLitAlt</span></a></span><span> </span><span id="local-6989586621680953335"><span class="annot"><span class="annottext">alts :: [GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953335"><span class="hs-identifier hs-var">alts</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">AltCon
</span><a href="GHC.Core.html#DEFAULT"><span class="hs-identifier hs-var">DEFAULT</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[BinderP 'Vanilla]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953335"><span class="hs-identifier hs-var">alts</span></a></span><span>
</span><span id="line-819"></span><span class="annot"><a href="GHC.Stg.Unarise.html#mkDefaultLitAlt"><span class="hs-identifier hs-var">mkDefaultLitAlt</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#LitAlt"><span class="hs-identifier hs-type">LitAlt</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span id="local-6989586621680953334"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953334"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680953333"><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953333"><span class="hs-identifier hs-var">alts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">AltCon
</span><a href="GHC.Core.html#DEFAULT"><span class="hs-identifier hs-var">DEFAULT</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680953334"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(AltCon, [Id], GenStgExpr 'Vanilla)
-&gt; [(AltCon, [Id], GenStgExpr 'Vanilla)]
-&gt; [(AltCon, [Id], GenStgExpr 'Vanilla)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953333"><span class="hs-identifier hs-var">alts</span></a></span><span>
</span><span id="line-820"></span><span class="annot"><a href="GHC.Stg.Unarise.html#mkDefaultLitAlt"><span class="hs-identifier hs-var">mkDefaultLitAlt</span></a></span><span> </span><span id="local-6989586621680953332"><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953332"><span class="hs-identifier hs-var">alts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; [(AltCon, [Id], GenStgExpr 'Vanilla)]
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;mkDefaultLitAlt&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Not a lit alt:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)] -&gt; SDoc
forall a b (pass :: StgPass).
(Outputable a, Outputable b, OutputablePass pass) =&gt;
[(a, b, GenStgExpr pass)] -&gt; SDoc
</span><a href="GHC.Stg.Unarise.html#pprPanicAlts"><span class="hs-identifier hs-var">pprPanicAlts</span></a></span><span> </span><span class="annot"><span class="annottext">[(AltCon, [Id], GenStgExpr 'Vanilla)]
[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680953332"><span class="hs-identifier hs-var">alts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-821"></span><span>
</span><span id="line-822"></span><span id="local-6989586621680953955"><span id="local-6989586621680953956"><span id="local-6989586621680953957"><span class="annot"><a href="GHC.Stg.Unarise.html#pprPanicAlts"><span class="hs-identifier hs-type">pprPanicAlts</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680953957"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680953956"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#OutputablePass"><span class="hs-identifier hs-type">OutputablePass</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680953955"><span class="hs-identifier hs-type">pass</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680953957"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621680953956"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Stg.Syntax.html#GenStgExpr"><span class="hs-identifier hs-type">GenStgExpr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680953955"><span class="hs-identifier hs-type">pass</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span></span></span></span><span>
</span><span id="line-823"></span><span id="pprPanicAlts"><span class="annot"><span class="annottext">pprPanicAlts :: forall a b (pass :: StgPass).
(Outputable a, Outputable b, OutputablePass pass) =&gt;
[(a, b, GenStgExpr pass)] -&gt; SDoc
</span><a href="GHC.Stg.Unarise.html#pprPanicAlts"><span class="hs-identifier hs-var hs-var">pprPanicAlts</span></a></span></span><span> </span><span id="local-6989586621680953318"><span class="annot"><span class="annottext">[(a, b, GenStgExpr pass)]
</span><a href="#local-6989586621680953318"><span class="hs-identifier hs-var">alts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((a, b, GenStgExpr pass) -&gt; SDoc)
-&gt; [(a, b, GenStgExpr pass)] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(a, b, GenStgExpr pass) -&gt; SDoc
forall a b (pass :: StgPass).
(Outputable a, Outputable b, OutputablePass pass) =&gt;
(a, b, GenStgExpr pass) -&gt; SDoc
</span><a href="GHC.Stg.Unarise.html#pprPanicAlt"><span class="hs-identifier hs-var">pprPanicAlt</span></a></span><span> </span><span class="annot"><span class="annottext">[(a, b, GenStgExpr pass)]
</span><a href="#local-6989586621680953318"><span class="hs-identifier hs-var">alts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-824"></span><span>
</span><span id="line-825"></span><span id="local-6989586621680953946"><span id="local-6989586621680953947"><span id="local-6989586621680953948"><span class="annot"><a href="GHC.Stg.Unarise.html#pprPanicAlt"><span class="hs-identifier hs-type">pprPanicAlt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680953948"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680953947"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#OutputablePass"><span class="hs-identifier hs-type">OutputablePass</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680953946"><span class="hs-identifier hs-type">pass</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680953948"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621680953947"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Stg.Syntax.html#GenStgExpr"><span class="hs-identifier hs-type">GenStgExpr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680953946"><span class="hs-identifier hs-type">pass</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span></span></span></span><span>
</span><span id="line-826"></span><span id="pprPanicAlt"><span class="annot"><span class="annottext">pprPanicAlt :: forall a b (pass :: StgPass).
(Outputable a, Outputable b, OutputablePass pass) =&gt;
(a, b, GenStgExpr pass) -&gt; SDoc
</span><a href="GHC.Stg.Unarise.html#pprPanicAlt"><span class="hs-identifier hs-var hs-var">pprPanicAlt</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680953306"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680953306"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621680953305"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621680953305"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621680953304"><span class="annot"><span class="annottext">GenStgExpr pass
</span><a href="#local-6989586621680953304"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a, b, SDoc) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680953306"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621680953305"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">StgPprOpts -&gt; GenStgExpr pass -&gt; SDoc
forall (pass :: StgPass).
OutputablePass pass =&gt;
StgPprOpts -&gt; GenStgExpr pass -&gt; SDoc
</span><a href="GHC.Stg.Syntax.html#pprStgExpr"><span class="hs-identifier hs-var">pprStgExpr</span></a></span><span> </span><span class="annot"><span class="annottext">StgPprOpts
</span><a href="GHC.Stg.Syntax.html#panicStgPprOpts"><span class="hs-identifier hs-var">panicStgPprOpts</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr pass
</span><a href="#local-6989586621680953304"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-827"></span></pre></body></html>